mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
fix disarm logic
This commit is contained in:
parent
ee0113ffff
commit
4b5972629e
1 changed files with 7 additions and 5 deletions
|
@ -123,6 +123,13 @@ void updateGPSRescueState(void)
|
||||||
hoverThrottle = gpsRescueConfig()->throttleHover;
|
hoverThrottle = gpsRescueConfig()->throttleHover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Minimum distance detection (100m). Disarm regardless of sanity check configuration. Rescue too close is never a good idea.
|
||||||
|
if (rescueState.sensor.distanceToHome < 100) {
|
||||||
|
rescueState.failure = RESCUE_TOO_CLOSE;
|
||||||
|
setArmingDisabled(ARMING_DISABLED_ARM_SWITCH);
|
||||||
|
disarm();
|
||||||
|
}
|
||||||
|
|
||||||
rescueState.phase = RESCUE_ATTAIN_ALT;
|
rescueState.phase = RESCUE_ATTAIN_ALT;
|
||||||
FALLTHROUGH;
|
FALLTHROUGH;
|
||||||
case RESCUE_ATTAIN_ALT:
|
case RESCUE_ATTAIN_ALT:
|
||||||
|
@ -284,11 +291,6 @@ void performSanityChecks()
|
||||||
if (msI == 5) {
|
if (msI == 5) {
|
||||||
rescueState.failure = RESCUE_FLYAWAY;
|
rescueState.failure = RESCUE_FLYAWAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Minimum distance detection (100m)
|
|
||||||
if (rescueState.sensor.distanceToHome < 100) {
|
|
||||||
rescueState.failure = RESCUE_TOO_CLOSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rescueStart()
|
void rescueStart()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue