Added confirmation dialog on power down and USB connected.

This commit is contained in:
Raphael Coeffic
2021-05-24 16:23:06 +02:00
committed by Raphael Coeffic
parent 273ab9bfee
commit 4fe4c1a385
16 changed files with 27 additions and 3 deletions
+12 -3
View File
@@ -2053,7 +2053,8 @@ uint32_t pwrCheck()
#if defined(SHUTDOWN_CONFIRMATION)
while (1)
#else
while ((TELEMETRY_STREAMING() && !g_eeGeneral.disableRssiPoweroffAlarm))
while (usbPlugged() ||
(TELEMETRY_STREAMING() && !g_eeGeneral.disableRssiPoweroffAlarm))
#endif
{
@@ -2091,8 +2092,16 @@ uint32_t pwrCheck()
}
#else // COLORLCD
// TODO: abort dialog condition (here, RSSI lost)
if (confirmationDialog(STR_MODEL_SHUTDOWN, STR_MODEL_STILL_POWERED, false)) {
const char* message = nullptr;
if (usbPlugged()) {
message = STR_USB_STILL_CONNECTED;
}
else {
message = STR_MODEL_STILL_POWERED;
}
// TODO: abort dialog condition (here, RSSI lost / USB connected)
if (confirmationDialog(STR_MODEL_SHUTDOWN, message, false)) {
pwr_check_state = PWR_CHECK_OFF;
return e_power_off;
} else {