diff --git a/src/main/sensors/gyro.c b/src/main/sensors/gyro.c index e7b64757fb..04df73ccf4 100644 --- a/src/main/sensors/gyro.c +++ b/src/main/sensors/gyro.c @@ -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++) {