Merge pull request #3608 from Vidalcris/patch-1

Update pid.c CrashRecovery
This commit is contained in:
Martin Budden 2017-07-23 14:26:56 +01:00 committed by GitHub
commit 498603d9da
1 changed files with 1 additions and 1 deletions

View File

@ -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)) {
if (pidProfile->crash_recovery && inCrashRecoveryMode == false && sensors(SENSOR_ACC) && ARMING_FLAG(ARMED)) {
if (motorMixRange >= 1.0f
&& ABS(delta) > crashDtermThreshold
&& ABS(errorRate) > crashGyroThreshold