mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
Check model is off before changing model
This commit is contained in:
parent
06d3110d7c
commit
ac9f510005
5 changed files with 37 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue