mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
Added 'disarm' option to crash recovery.
This commit is contained in:
parent
22b9f34532
commit
247f759652
3 changed files with 9 additions and 4 deletions
|
@ -886,8 +886,12 @@ static void detectAndSetCrashRecovery(
|
|||
&& fabsf(delta) > crashDtermThreshold
|
||||
&& fabsf(errorRate) > crashGyroThreshold
|
||||
&& fabsf(getSetpointRate(axis)) < crashSetpointThreshold) {
|
||||
inCrashRecoveryMode = true;
|
||||
crashDetectedAtUs = currentTimeUs;
|
||||
if (crash_recovery == PID_CRASH_RECOVERY_DISARM) {
|
||||
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