mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Fix CPU bug due toe reinitialising of filters
This commit is contained in:
parent
da9673b982
commit
4ff2802095
2 changed files with 3 additions and 1 deletions
|
@ -116,11 +116,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue