Skip to content

Commit

Permalink
Fix unable to disable GPS HOME mode. Fixes multiwii#91.
Browse files Browse the repository at this point in the history
  • Loading branch information
hydra committed Sep 26, 2014
1 parent 6883a8f commit 03a5a20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/flight/navigation.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,15 @@ void updateGpsWaypointsAndMode(void)
if (STATE(GPS_FIX) && GPS_numSat >= 5) {
// if both GPS_HOME & GPS_HOLD are checked => GPS_HOME is the priority
if (rcOptions[BOXGPSHOME]) {
if (!STATE(GPS_HOME_MODE)) {
if (!FLIGHT_MODE(GPS_HOME_MODE)) {
ENABLE_FLIGHT_MODE(GPS_HOME_MODE);
DISABLE_FLIGHT_MODE(GPS_HOLD_MODE);
GPSNavReset = 0;
GPS_set_next_wp(&GPS_home[LAT], &GPS_home[LON]);
nav_mode = NAV_MODE_WP;
}
} else {
DISABLE_STATE(GPS_HOME_MODE);
DISABLE_FLIGHT_MODE(GPS_HOME_MODE);

if (rcOptions[BOXGPSHOLD] && areSticksInApModePosition(gpsProfile->ap_mode)) {
if (!FLIGHT_MODE(GPS_HOLD_MODE)) {
Expand Down

0 comments on commit 03a5a20

Please sign in to comment.