From e4d3a8c249d5e4f7f7d15b413e0b51bf62ad52c7 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 18 Aug 2024 15:03:19 -0400 Subject: [PATCH] only:nicer error message --- firmware/util/math/biquad.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/util/math/biquad.cpp b/firmware/util/math/biquad.cpp index a2b11546a5..a703611aaf 100644 --- a/firmware/util/math/biquad.cpp +++ b/firmware/util/math/biquad.cpp @@ -30,7 +30,10 @@ static float getNorm(float K, float Q) { } void Biquad::configureBandpass(float samplingFrequency, float centerFrequency, float Q) { - criticalAssertVoid(samplingFrequency >= 2.5f * centerFrequency, "Invalid biquad parameters"); + if (samplingFrequency < 2.5f * centerFrequency) { + criticalError("Invalid biquad parameters %f %f", samplingFrequency, centerFrequency); + return; + } float K = getK(samplingFrequency, centerFrequency); float norm = getNorm(K, Q);