Show warning LED with switch and throttle alerts

Show warning LED for switch, throttle and ALERTS generally
i.e. MULTI failsafe not set, low RTC battery, storage warning
This commit is contained in:
Peter Feerick
2022-01-08 14:12:26 +10:00
committed by Peter Feerick
parent 88ade987a7
commit f8c01c3988
3 changed files with 10 additions and 4 deletions
@@ -201,9 +201,11 @@ void raiseAlert(const char * title, const char * msg, const char * action, uint8
{
TRACE("raiseAlert('%s')", msg);
AUDIO_ERROR_MESSAGE(sound);
LED_ERROR_BEGIN();
auto dialog = new FullScreenDialog(WARNING_TYPE_ALERT, title ? title : "",
msg ? msg : "", action ? action : "");
dialog->runForever();
LED_ERROR_END();
}
// POPUP_CONFIRMATION
+6 -4
View File
@@ -783,12 +783,14 @@ bool isThrottleWarningAlertNeeded()
void checkThrottleStick()
{
if (isThrottleWarningAlertNeeded()) {
LED_ERROR_BEGIN();
AUDIO_ERROR_MESSAGE(AU_THROTTLE_ALERT);
auto dialog = new FullScreenDialog(WARNING_TYPE_ALERT, TR_THROTTLE_UPPERCASE, STR_THROTTLE_NOT_IDLE, STR_PRESS_ANY_KEY_TO_SKIP);
dialog->setCloseCondition([]() {
return !isThrottleWarningAlertNeeded();
});
auto dialog =
new FullScreenDialog(WARNING_TYPE_ALERT, TR_THROTTLE_UPPERCASE,
STR_THROTTLE_NOT_IDLE, STR_PRESS_ANY_KEY_TO_SKIP);
dialog->setCloseCondition([]() { return !isThrottleWarningAlertNeeded(); });
dialog->runForever();
LED_ERROR_END();
}
}
#else
+2
View File
@@ -733,8 +733,10 @@ void checkSwitches()
if (!isSwitchWarningRequired(bad_pots))
return;
LED_ERROR_BEGIN();
auto dialog = new SwitchWarnDialog();
dialog->runForever();
LED_ERROR_END();
}
#elif defined(GUI)
void checkSwitches()