mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
Merge pull request #7924 from mikeller/add_crash_recovery_disarm
Added 'disarm' option to crash recovery.
This commit is contained in:
commit
b468b94995
10 changed files with 38 additions and 27 deletions
|
@ -877,8 +877,13 @@ static void detectAndSetCrashRecovery(
|
|||
&& fabsf(delta) > crashDtermThreshold
|
||||
&& fabsf(errorRate) > crashGyroThreshold
|
||||
&& fabsf(getSetpointRate(axis)) < crashSetpointThreshold) {
|
||||
inCrashRecoveryMode = true;
|
||||
crashDetectedAtUs = currentTimeUs;
|
||||
if (crash_recovery == PID_CRASH_RECOVERY_DISARM) {
|
||||
setArmingDisabled(ARMING_DISABLED_CRASH_DETECTED);
|
||||
disarm();
|
||||
} else {
|
||||
inCrashRecoveryMode = true;
|
||||
crashDetectedAtUs = currentTimeUs;
|
||||
}
|
||||
}
|
||||
if (inCrashRecoveryMode && cmpTimeUs(currentTimeUs, crashDetectedAtUs) < crashTimeDelayUs && (fabsf(errorRate) < crashGyroThreshold
|
||||
|| fabsf(getSetpointRate(axis)) > crashSetpointThreshold)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue