1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Suppress OSD stats screen if runaway takeoff triggered the disarm (#5402)

and OSD_WARNINGS is visible in the OSD.

The stats screen was preventing the user from knowing that a disarm might be casued by runaway takeoff.  If the warnings element is visible it will have the message "RUNAWAY" but the disarm it triggers caused the stats display to replace the screen.

The change prevents the stats page from displaying if the ARMING_DISABLED_RUNAWAY_TAKEOFF flag is set and the OSD_WARNINGS element is visible.  Otherwise the stats screen is displayed as normal.
This commit is contained in:
etracer65 2018-03-14 09:04:16 -04:00 committed by Michael Keller
parent 141d6ec30a
commit 27bc23c3bb

View file

@ -1243,7 +1243,9 @@ STATIC_UNIT_TESTED void osdRefresh(timeUs_t currentTimeUs)
osdResetStats();
osdShowArmed();
resumeRefreshAt = currentTimeUs + (REFRESH_1S / 2);
} else if (isSomeStatEnabled()) {
} else if (isSomeStatEnabled()
&& (!(getArmingDisableFlags() & ARMING_DISABLED_RUNAWAY_TAKEOFF)
|| !VISIBLE(osdConfig()->item_pos[OSD_WARNINGS]))) { // suppress stats if runaway takeoff triggered disarm and WARNINGS element is visible
osdShowStats();
resumeRefreshAt = currentTimeUs + (60 * REFRESH_1S);
}