1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 07:15:18 +03:00

Fix CPU bug due toe reinitialising of filters

This commit is contained in:
borisbstyle 2016-08-09 16:18:06 +02:00
parent f933e316c6
commit 107f09d6e1
2 changed files with 3 additions and 1 deletions

View file

@ -114,11 +114,13 @@ void initFilters(const pidProfile_t *pidProfile)
if (pidProfile->dterm_notch_hz && !dtermNotchInitialised) {
float notchQ = filterGetNotchQ(pidProfile->dterm_notch_hz, pidProfile->dterm_notch_cutoff);
for (axis = 0; axis < 3; axis++) biquadFilterInit(&dtermFilterNotch[axis], pidProfile->dterm_notch_hz, gyro.targetLooptime, notchQ, FILTER_NOTCH);
dtermNotchInitialised = true;
}
if (pidProfile->dterm_filter_type == FILTER_BIQUAD) {
if (pidProfile->dterm_lpf_hz && !dtermBiquadLpfInitialised) {
for (axis = 0; axis < 3; axis++) biquadFilterInitLPF(&dtermFilterLpf[axis], pidProfile->dterm_lpf_hz, gyro.targetLooptime);
dtermBiquadLpfInitialised = true;
}
}
}