Skip to content

Commit

Permalink
CR18 to CR21
Browse files Browse the repository at this point in the history
  • Loading branch information
breadoven committed Apr 15, 2024
1 parent 67759b1 commit f6386c3
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 65 deletions.
10 changes: 9 additions & 1 deletion src/main/blackbox/blackbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,9 +1309,17 @@ static void loadSlowState(blackboxSlowState_t *slow)
{
memcpy(&slow->flightModeFlags, &rcModeActivationMask, sizeof(slow->flightModeFlags)); //was flightModeFlags;
// Also log Nav auto selected flight modes rather than just those selected by boxmode
if (!IS_RC_MODE_ACTIVE(BOXANGLE) && FLIGHT_MODE(ANGLE_MODE)) {
// CR118
if (FLIGHT_MODE(ANGLE_MODE)) {
slow->flightModeFlags |= (1 << BOXANGLE);
}
if (FLIGHT_MODE(NAV_ALTHOLD_MODE)) {
slow->flightModeFlags |= (1 << BOXNAVALTHOLD);
}
if (FLIGHT_MODE(NAV_RTH_MODE)) {
slow->flightModeFlags |= (1 << BOXNAVRTH);
}
// CR118
if (navigationGetHeadingControlState() == NAV_HEADING_CONTROL_AUTO) {
slow->flightModeFlags |= (1 << BOXHEADINGHOLD);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/fc/fc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ static void updateArmingStatus(void)
DISABLE_ARMING_FLAG(ARMING_DISABLED_NO_PREARM);
}

if (ARMING_FLAG(ARMING_DISABLED_LANDING_DETECTED) && !IS_RC_MODE_ACTIVE(BOXARM)) {
DISABLE_ARMING_FLAG(ARMING_DISABLED_LANDING_DETECTED);
}

/* CHECK: Arming switch */
// If arming is disabled and the ARM switch is on
// Note that this should be last check so all other blockers could be cleared correctly
Expand Down
6 changes: 5 additions & 1 deletion src/main/io/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5427,6 +5427,7 @@ static void osdRefresh(timeUs_t currentTimeUs)
static uint8_t statsCurrentPage = 0;
static bool statsDisplayed = false;
static bool statsAutoPagingEnabled = true;
static bool throttleHigh = false; // CR119

// Detect arm/disarm
if (armState != ARMING_FLAG(ARMED)) {
Expand All @@ -5447,6 +5448,8 @@ static void osdRefresh(timeUs_t currentTimeUs)
osdSetNextRefreshIn(delay);
} else {
// Display the "Stats" screen

throttleHigh = checkStickPosition(THR_HI); // CR119
statsDisplayed = true;
statsCurrentPage = 0;
statsAutoPagingEnabled = osdConfig()->stats_page_auto_swap_time > 0 ? true : false;
Expand Down Expand Up @@ -5517,7 +5520,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 && !throttleHigh)) { // CR119
// Time elapsed or canceled by stick commands.
// Exit to normal OSD operation.
displayClearScreen(osdDisplayPort);
Expand All @@ -5526,6 +5529,7 @@ static void osdRefresh(timeUs_t currentTimeUs)
} else {
// Continue "Splash", "Armed" or "Stats" screens.
displayHeartbeat(osdDisplayPort);
throttleHigh = checkStickPosition(THR_HI); // CR119
}

return;
Expand Down
Loading

0 comments on commit f6386c3

Please sign in to comment.