From 15880b1ab44a74bc876a5ef5f190b1b4bf4d7f7b Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 5 Nov 2023 18:02:20 +1000 Subject: [PATCH] feat: No haptic if haptic mode quiet set --- radio/src/opentx.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 0e019ff92ef..d4475a45ed4 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -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 } @@ -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 } } @@ -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: @@ -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; }