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:
parent
99f223c2fd
commit
b69e97fb23
1 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue