From 27bc23c3bb38d9b186e1e6249afbf3a082d78e15 Mon Sep 17 00:00:00 2001 From: etracer65 Date: Wed, 14 Mar 2018 09:04:16 -0400 Subject: [PATCH] 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. --- src/main/io/osd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 5cbccb6a05..726f9544fa 100644 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -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); }