Skip to content

Commit 523c483

Browse files
authored
Merge pull request #9951 from breadoven/abo_stats_throttle_high_fix
Prevent high throttle auto cancelling OSD stats screen on disarm
2 parents 00fa921 + 17e7855 commit 523c483

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/io/osd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4864,6 +4864,7 @@ static void osdRefresh(timeUs_t currentTimeUs)
48644864
static uint8_t statsCurrentPage = 0;
48654865
static bool statsDisplayed = false;
48664866
static bool statsAutoPagingEnabled = true;
4867+
static bool isThrottleHigh = false;
48674868

48684869
// Detect arm/disarm
48694870
if (armState != ARMING_FLAG(ARMED)) {
@@ -4889,6 +4890,7 @@ static void osdRefresh(timeUs_t currentTimeUs)
48894890
statsAutoPagingEnabled = osdConfig()->stats_page_auto_swap_time > 0 ? true : false;
48904891
osdShowStats(statsSinglePageCompatible, statsCurrentPage);
48914892
osdSetNextRefreshIn(STATS_SCREEN_DISPLAY_TIME);
4893+
isThrottleHigh = checkStickPosition(THR_HI);
48924894
}
48934895

48944896
armState = ARMING_FLAG(ARMED);
@@ -4954,7 +4956,7 @@ static void osdRefresh(timeUs_t currentTimeUs)
49544956
}
49554957

49564958
// Handle events when either "Splash", "Armed" or "Stats" screens are displayed.
4957-
if ((currentTimeUs > resumeRefreshAt) || OSD_RESUME_UPDATES_STICK_COMMAND) {
4959+
if (currentTimeUs > resumeRefreshAt || (OSD_RESUME_UPDATES_STICK_COMMAND && !isThrottleHigh)) {
49584960
// Time elapsed or canceled by stick commands.
49594961
// Exit to normal OSD operation.
49604962
displayClearScreen(osdDisplayPort);
@@ -4963,6 +4965,7 @@ static void osdRefresh(timeUs_t currentTimeUs)
49634965
} else {
49644966
// Continue "Splash", "Armed" or "Stats" screens.
49654967
displayHeartbeat(osdDisplayPort);
4968+
isThrottleHigh = checkStickPosition(THR_HI);
49664969
}
49674970

49684971
return;

0 commit comments

Comments
 (0)