From 15880b1ab44a74bc876a5ef5f190b1b4bf4d7f7b Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 5 Nov 2023 18:02:20 +1000 Subject: [PATCH 1/4] 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; } From 11cfb48752bb15e56f99d5e1c68e754a15c3189e Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 5 Nov 2023 18:11:35 +1000 Subject: [PATCH 2/4] fix(color): Reset LED color at end of throttle check Was part of #4027 --- radio/src/opentx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index d4475a45ed4..eb0b7c000e8 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -909,8 +909,8 @@ void checkThrottleStick() throttleNotIdle, STR_PRESS_ANY_KEY_TO_SKIP); dialog->setCloseCondition([]() { return !isThrottleWarningAlertNeeded(); }); dialog->runForever(); - LED_ERROR_END(); } + LED_ERROR_END(); } #else void checkThrottleStick() From 7bb3b1f2fc4432464773927c251ecde0ee040be3 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 5 Nov 2023 18:17:39 +1000 Subject: [PATCH 3/4] fix(color): Read radio settings so haptic opt read --- radio/src/opentx.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index eb0b7c000e8..ac61c0eefad 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1555,13 +1555,21 @@ void opentxInit() lcdClear(); lcdRefresh(); lcdRefreshWait(); +#endif - bool radioSettingsValid = storageReadRadioSettings(false); - (void)radioSettingsValid; + // Load radio.yml so radio settings can be used + bool radioSettingsValid = false; +#if defined(RTC_BACKUP_RAM) + // Skip loading if EM startup and radio has RTC backup data + if (!UNEXPECTED_SHUTDOWN()) + radioSettingsValid = storageReadRadioSettings(false); +#else + // No RTC backup - try and load even for EM startup + radioSettingsValid = storageReadRadioSettings(false); +#endif #if defined(GUI) && !defined(COLORLCD) lcdSetContrast(); -#endif #endif BACKLIGHT_ENABLE(); // we start the backlight during the startup animation From e500bae2c342d436d056f8745a053abb6001efee Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 5 Nov 2023 19:12:18 +1000 Subject: [PATCH 4/4] fix: hapticOff not option dependent --- radio/src/opentx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index ac61c0eefad..0c94b9f4918 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) - if (g_eeGeneral.hapticMode != e_mode_quiet) hapticOff(); + hapticOff(); #endif }