1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

Merge pull request #10057 from etracer65/gps_rescue_fixed_wing_disable

Disable GPS RESCUE if mixer is fixed-wing type
This commit is contained in:
Michael Keller 2020-07-30 00:33:44 +12:00
parent 11d877fcf6
commit 7019b53afa
4 changed files with 10 additions and 5 deletions

View file

@ -371,7 +371,7 @@ static void validateAndFixConfig(void)
#endif #endif
if ( if (
featureIsConfigured(FEATURE_3D) || !featureIsConfigured(FEATURE_GPS) featureIsConfigured(FEATURE_3D) || !featureIsConfigured(FEATURE_GPS) || mixerModeIsFixedWing(mixerConfig()->mixerMode)
#if !defined(USE_GPS) || !defined(USE_GPS_RESCUE) #if !defined(USE_GPS) || !defined(USE_GPS_RESCUE)
|| true || true
#endif #endif

View file

@ -999,10 +999,9 @@ mixerMode_e getMixerMode(void)
return currentMixerMode; return currentMixerMode;
} }
bool mixerModeIsFixedWing(mixerMode_e mixerMode)
bool isFixedWing(void)
{ {
switch (currentMixerMode) { switch (mixerMode) {
case MIXER_FLYING_WING: case MIXER_FLYING_WING:
case MIXER_AIRPLANE: case MIXER_AIRPLANE:
case MIXER_CUSTOM_AIRPLANE: case MIXER_CUSTOM_AIRPLANE:
@ -1015,3 +1014,8 @@ bool isFixedWing(void)
break; break;
} }
} }
bool isFixedWing(void)
{
return mixerModeIsFixedWing(currentMixerMode);
}

View file

@ -115,4 +115,5 @@ bool mixerIsTricopter(void);
void mixerSetThrottleAngleCorrection(int correctionValue); void mixerSetThrottleAngleCorrection(int correctionValue);
float mixerGetThrottle(void); float mixerGetThrottle(void);
mixerMode_e getMixerMode(void); mixerMode_e getMixerMode(void);
bool mixerModeIsFixedWing(mixerMode_e mixerMode);
bool isFixedWing(void); bool isFixedWing(void);

View file

@ -213,7 +213,7 @@ void initActiveBoxIds(void)
#ifdef USE_GPS #ifdef USE_GPS
if (featureIsEnabled(FEATURE_GPS)) { if (featureIsEnabled(FEATURE_GPS)) {
#ifdef USE_GPS_RESCUE #ifdef USE_GPS_RESCUE
if (!featureIsEnabled(FEATURE_3D)) { if (!featureIsEnabled(FEATURE_3D) && !isFixedWing()) {
BME(BOXGPSRESCUE); BME(BOXGPSRESCUE);
} }
#endif #endif