Check model is off before changing model - Fixes #7715 (#7719)

Check model is off before changing model
This commit is contained in:
DanielGeA
2020-07-31 16:27:31 +02:00
committed by GitHub
parent 06d3110d7c
commit ac9f510005
5 changed files with 37 additions and 0 deletions
+19
View File
@@ -805,6 +805,25 @@ bool modelHasNotes()
return false;
}
bool confirmModelChange()
{
if (TELEMETRY_STREAMING()) {
RAISE_ALERT(STR_MODEL, STR_MODEL_STILL_POWERED, STR_PRESS_ENTER_TO_CONFIRM, AU_MODEL_STILL_POWERED);
while (TELEMETRY_STREAMING()) {
RTOS_WAIT_MS(20);
if (readKeys() == (1 << KEY_ENTER)) {
killEvents(KEY_ENTER);
return true;
}
else if (readKeys() == (1 << KEY_EXIT)) {
killEvents(KEY_EXIT);
return false;
}
}
}
return true;
}
int getFirstAvailable(int min, int max, IsValueAvailable isValueAvailable)
{
int retval = 0;