[colorlcd] Warn on model change if telemetry-enabled model connected (#1467)
* Warn on connected model (#1466) * Make it so not confirming aborts model change * add delay before accepting disconnected telemtry * Add power off delay * Remove whitespace + time unit in name Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
@@ -2048,6 +2048,10 @@ uint32_t pwrPressedDuration()
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(COLORLCD)
|
||||
inline tmr10ms_t getTicks() { return g_tmr10ms; }
|
||||
#endif
|
||||
|
||||
uint32_t pwrCheck()
|
||||
{
|
||||
const char * message = nullptr;
|
||||
@@ -2138,7 +2142,11 @@ uint32_t pwrCheck()
|
||||
}
|
||||
else if (!modelConnectedConfirmed) {
|
||||
message = STR_MODEL_STILL_POWERED;
|
||||
closeCondition = [](){
|
||||
closeCondition = []() {
|
||||
tmr10ms_t startTime = getTicks();
|
||||
while (!TELEMETRY_STREAMING()) {
|
||||
if (getTicks() - startTime > TELEMETRY_CHECK_DELAY10ms) break;
|
||||
}
|
||||
return !TELEMETRY_STREAMING() || g_eeGeneral.disableRssiPoweroffAlarm;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user