1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +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 committed by GitHub
commit a752d3d218
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 5 deletions

View file

@ -372,7 +372,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

@ -992,10 +992,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:
@ -1008,3 +1007,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

@ -214,7 +214,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