1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +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
if (
featureIsConfigured(FEATURE_3D) || !featureIsConfigured(FEATURE_GPS)
featureIsConfigured(FEATURE_3D) || !featureIsConfigured(FEATURE_GPS) || mixerModeIsFixedWing(mixerConfig()->mixerMode)
#if !defined(USE_GPS) || !defined(USE_GPS_RESCUE)
|| true
#endif

View file

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

View file

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

View file

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