Skip to content

Commit

Permalink
Fix trackback error
Browse files Browse the repository at this point in the history
  • Loading branch information
breadoven committed May 13, 2024
1 parent 75ea2ce commit 6f4ff6b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/navigation/navigation.c
Original file line number Diff line number Diff line change
Expand Up @@ -1448,10 +1448,7 @@ static navigationFSMEvent_t navOnEnteringState_NAV_STATE_RTH_INITIALIZE(navigati
}
else {
// Switch to RTH trackback
bool trackbackActive = navConfig()->general.flags.rth_trackback_mode == RTH_TRACKBACK_ON ||
(navConfig()->general.flags.rth_trackback_mode == RTH_TRACKBACK_FS && posControl.flags.forcedRTHActivated);

if (trackbackActive && rth_trackback.activePointIndex >= 0 && !isWaypointMissionRTHActive()) {
if (rthTrackBackIsActive() && rth_trackback.activePointIndex >= 0 && !isWaypointMissionRTHActive()) {
rthTrackBackUpdate(true); // save final trackpoint for altitude and max trackback distance reference
posControl.flags.rthTrackbackActive = true;
calculateAndSetActiveWaypointToLocalPosition(getRthTrackBackPosition());
Expand Down Expand Up @@ -3200,7 +3197,7 @@ bool rthAltControlStickOverrideCheck(uint8_t axis)
(axis == ROLL && STATE(MULTIROTOR) && !posControl.flags.rthTrackbackActive)) {
return false;
}

static timeMs_t rthOverrideStickHoldStartTime[2];

if (rxGetChannelValue(axis) > rxConfig()->maxcheck) {
Expand Down

0 comments on commit 6f4ff6b

Please sign in to comment.