mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Check if notch cutoff is zero in filter init
This commit is contained in:
parent
869dd1f00e
commit
6e52b82e1c
1 changed files with 2 additions and 2 deletions
|
@ -415,7 +415,7 @@ void gyroInitFilterNotch1(gyroSensor_t *gyroSensor, uint16_t notchHz, uint16_t n
|
|||
|
||||
notchHz = calculateNyquistAdjustedNotchHz(notchHz, notchCutoffHz);
|
||||
|
||||
if (notchHz) {
|
||||
if (notchHz != 0 && notchCutoffHz != 0) {
|
||||
gyroSensor->notchFilter1ApplyFn = (filterApplyFnPtr)biquadFilterApply;
|
||||
const float notchQ = filterGetNotchQ(notchHz, notchCutoffHz);
|
||||
for (int axis = 0; axis < 3; axis++) {
|
||||
|
@ -430,7 +430,7 @@ void gyroInitFilterNotch2(gyroSensor_t *gyroSensor, uint16_t notchHz, uint16_t n
|
|||
|
||||
notchHz = calculateNyquistAdjustedNotchHz(notchHz, notchCutoffHz);
|
||||
|
||||
if (notchHz) {
|
||||
if (notchHz != 0 && notchCutoffHz != 0) {
|
||||
gyroSensor->notchFilter2ApplyFn = (filterApplyFnPtr)biquadFilterApply;
|
||||
const float notchQ = filterGetNotchQ(notchHz, notchCutoffHz);
|
||||
for (int axis = 0; axis < 3; axis++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue