Skip to content

Commit

Permalink
Merge pull request iNavFlight#9951 from breadoven/abo_stats_throttle_…
Browse files Browse the repository at this point in the history
…high_fix

Prevent high throttle auto cancelling OSD stats screen on disarm
  • Loading branch information
DzikuVx authored Apr 22, 2024
2 parents 00fa921 + 17e7855 commit 523c483
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/io/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -4864,6 +4864,7 @@ static void osdRefresh(timeUs_t currentTimeUs)
static uint8_t statsCurrentPage = 0;
static bool statsDisplayed = false;
static bool statsAutoPagingEnabled = true;
static bool isThrottleHigh = false;

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

armState = ARMING_FLAG(ARMED);
Expand Down Expand Up @@ -4954,7 +4956,7 @@ static void osdRefresh(timeUs_t currentTimeUs)
}

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

return;
Expand Down

0 comments on commit 523c483

Please sign in to comment.