Skip to content

Commit

Permalink
feat: No haptic if haptic mode quiet set
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeerick committed Nov 5, 2023
1 parent 085a12b commit 15880b1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions radio/src/opentx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ void opentxClose(uint8_t shutdown)
AUDIO_BYE();
// TODO needed? telemetryEnd();
#if defined(HAPTIC)
hapticOff();
if (g_eeGeneral.hapticMode != e_mode_quiet) hapticOff();
#endif
}

Expand Down Expand Up @@ -1479,7 +1479,9 @@ void runStartupAnimation()
else if (!isPowerOn) {
isPowerOn = true;
pwrOn();
haptic.play(15, 3, PLAY_NOW);
#if defined(HAPTIC)
if (g_eeGeneral.hapticMode != e_mode_quiet) haptic.play(15, 3, PLAY_NOW);
#endif
}
}

Expand Down Expand Up @@ -1573,7 +1575,9 @@ void opentxInit()
}
#else // defined(PWR_BUTTON_PRESS)
pwrOn();
haptic.play(15, 3, PLAY_NOW);
#if defined(HAPTIC)
if (g_eeGeneral.hapticMode != e_mode_quiet) haptic.play(15, 3, PLAY_NOW);
#endif
#endif

// Radios handle UNEXPECTED_SHUTDOWN() differently:
Expand Down Expand Up @@ -1917,8 +1921,10 @@ uint32_t pwrCheck()

#endif // COLORLCD
}

haptic.play(15, 3, PLAY_NOW);
#if defined(HAPTIC)
if (g_eeGeneral.hapticMode != e_mode_quiet)
haptic.play(15, 3, PLAY_NOW);
#endif
pwr_check_state = PWR_CHECK_OFF;
return e_power_off;
}
Expand Down

0 comments on commit 15880b1

Please sign in to comment.