File tree Expand file tree Collapse file tree
src/SCRIPTS/TOOLS/ExpressLRS Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,6 +162,14 @@ function Protocol.isConnected()
162162 return bit32.btest (Protocol .elrsFlags , 1 )
163163end
164164
165+ function Protocol .isModelMismatch ()
166+ return bit32.btest (Protocol .elrsFlags , 0x04 )
167+ end
168+
169+ function Protocol .hasCriticalError ()
170+ return Protocol .elrsFlags > Protocol .CRSF .ELRS_FLAGS_WARNING_THRESHOLD
171+ end
172+
165173-- Response timeout for PARAMETER_READ:
166174-- 0.5s for local TX module, 5s for remote devices relayed over air link.
167175function Protocol .fieldResponseTimeout ()
Original file line number Diff line number Diff line change @@ -584,7 +584,7 @@ local function handleWarning()
584584 end
585585 if Protocol .elrsFlags > Protocol .CRSF .ELRS_FLAGS_STATUS_MASK then
586586 if not UI .warningDialog and not UI .warningDismissed then
587- if Protocol .elrsFlagsInfo == " Model Mismatch " then
587+ if Protocol .isModelMismatch () then
588588 UI .warningDialog = ModelMismatchDialog .show (function ()
589589 UI .warningDismissed = true
590590 UI .warningDismissedAt = getTime ()
@@ -593,7 +593,7 @@ local function handleWarning()
593593 UI .warningDismissed = true
594594 App .shouldExit = true
595595 end )
596- else
596+ elseif Protocol . hasCriticalError () then
597597 Dialogs .showMessage ({
598598 title = " Warning" ,
599599 message = Protocol .elrsFlagsInfo ,
You can’t perform that action at this time.
0 commit comments