Fix backlight issue when storage is erased

and crash on PWR button press while a full-screen dialog is displayed.
This commit is contained in:
Raphael Coeffic
2021-05-26 16:08:12 +02:00
parent 945fc9510a
commit 038b8364f6
2 changed files with 11 additions and 2 deletions
+3 -1
View File
@@ -162,7 +162,8 @@ void FullScreenDialog::runForever()
#endif
}
else if (check == e_power_press) {
RTOS_WAIT_MS(20);
WDG_RESET();
RTOS_WAIT_MS(1);
continue;
}
@@ -193,6 +194,7 @@ void FullScreenDialog::runForeverNoPwrCheck()
void raiseAlert(const char * title, const char * msg, const char * action, uint8_t sound)
{
TRACE("raiseAlert('%s')", msg);
AUDIO_ERROR_MESSAGE(sound);
auto dialog = new FullScreenDialog(WARNING_TYPE_ALERT, title ? title : "",
msg ? msg : "", action ? action : "");
+8 -1
View File
@@ -39,11 +39,18 @@ void storageEraseAll(bool warn)
{
TRACE("storageEraseAll");
#if defined(LIBOPENUI)
#if defined(COLORLCD)
// the theme has not been loaded before
static_cast<OpenTxTheme*>(theme)->load();
#endif
// Init backlight mode before entering alert screens
requiredBacklightBright = BACKLIGHT_FORCED_ON;
#if defined(PCBHORUS)
g_eeGeneral.blOffBright = 20;
#endif
if (warn) {
ALERT(STR_STORAGE_WARNING, STR_BAD_RADIO_DATA, AU_BAD_RADIODATA);
}