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:
@@ -162,7 +162,8 @@ void FullScreenDialog::runForever()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (check == e_power_press) {
|
else if (check == e_power_press) {
|
||||||
RTOS_WAIT_MS(20);
|
WDG_RESET();
|
||||||
|
RTOS_WAIT_MS(1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,6 +194,7 @@ void FullScreenDialog::runForeverNoPwrCheck()
|
|||||||
|
|
||||||
void raiseAlert(const char * title, const char * msg, const char * action, uint8_t sound)
|
void raiseAlert(const char * title, const char * msg, const char * action, uint8_t sound)
|
||||||
{
|
{
|
||||||
|
TRACE("raiseAlert('%s')", msg);
|
||||||
AUDIO_ERROR_MESSAGE(sound);
|
AUDIO_ERROR_MESSAGE(sound);
|
||||||
auto dialog = new FullScreenDialog(WARNING_TYPE_ALERT, title ? title : "",
|
auto dialog = new FullScreenDialog(WARNING_TYPE_ALERT, title ? title : "",
|
||||||
msg ? msg : "", action ? action : "");
|
msg ? msg : "", action ? action : "");
|
||||||
|
|||||||
@@ -39,11 +39,18 @@ void storageEraseAll(bool warn)
|
|||||||
{
|
{
|
||||||
TRACE("storageEraseAll");
|
TRACE("storageEraseAll");
|
||||||
|
|
||||||
#if defined(LIBOPENUI)
|
#if defined(COLORLCD)
|
||||||
// the theme has not been loaded before
|
// the theme has not been loaded before
|
||||||
static_cast<OpenTxTheme*>(theme)->load();
|
static_cast<OpenTxTheme*>(theme)->load();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Init backlight mode before entering alert screens
|
||||||
|
requiredBacklightBright = BACKLIGHT_FORCED_ON;
|
||||||
|
|
||||||
|
#if defined(PCBHORUS)
|
||||||
|
g_eeGeneral.blOffBright = 20;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (warn) {
|
if (warn) {
|
||||||
ALERT(STR_STORAGE_WARNING, STR_BAD_RADIO_DATA, AU_BAD_RADIODATA);
|
ALERT(STR_STORAGE_WARNING, STR_BAD_RADIO_DATA, AU_BAD_RADIODATA);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user