1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

fix the logic to be a little bit more user friendly

This commit is contained in:
s0up 2018-07-17 15:14:21 -07:00
parent 99f223c2fd
commit b69e97fb23

View file

@ -125,9 +125,15 @@ void updateGPSRescueState(void)
// Minimum distance detection (100m). Disarm regardless of sanity check configuration. Rescue too close is never a good idea.
if (rescueState.sensor.distanceToHome < 100) {
// Never allow rescue mode to engage as a failsafe within 100 meters or when disarmed.
if (rescueState.isFailsafe || !ARMING_FLAG(ARMED)) {
rescueState.failure = RESCUE_TOO_CLOSE;
setArmingDisabled(ARMING_DISABLED_ARM_SWITCH);
disarm();
} else {
// Leave it up to the sanity check setting
rescueState.failure = RESCUE_TOO_CLOSE;
}
}
rescueState.phase = RESCUE_ATTAIN_ALT;