mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Update pid.c
added verification that the quad is armed to detect crash (thanks @martinbudden ;) )
This commit is contained in:
parent
c4f3a6101d
commit
3298c3d641
1 changed files with 1 additions and 1 deletions
|
@ -450,7 +450,7 @@ void pidController(const pidProfile_t *pidProfile, const rollAndPitchTrims_t *an
|
|||
previousRateError[axis] = rD;
|
||||
|
||||
// if crash recovery is on and accelerometer enabled then check for a crash
|
||||
if (pidProfile->crash_recovery && sensors(SENSOR_ACC) && inCrashRecoveryMode == false) {
|
||||
if (pidProfile->crash_recovery && inCrashRecoveryMode == false && sensors(SENSOR_ACC) && ARMING_FLAG(ARMED)) {
|
||||
if (motorMixRange >= 1.0f
|
||||
&& ABS(delta) > crashDtermThreshold
|
||||
&& ABS(errorRate) > crashGyroThreshold
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue