From b6964901cf4db39b5b569b43e9e343f47e0f9fbb Mon Sep 17 00:00:00 2001 From: Yegor Shytikov Date: Tue, 14 Jan 2025 09:33:17 -0800 Subject: [PATCH] add RADIOLIB_CHECK_PARAMS --- src/modules/LR11x0/LR1120.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/LR11x0/LR1120.cpp b/src/modules/LR11x0/LR1120.cpp index d066357a..45173f13 100644 --- a/src/modules/LR11x0/LR1120.cpp +++ b/src/modules/LR11x0/LR1120.cpp @@ -50,12 +50,14 @@ int16_t LR1120::setFrequency(float freq) { return(this->setFrequency(freq, false)); } -int16_t LR1120::setFrequency(float freq, bool skipCalibration, float band, bool skipRfValidation) { - if(!skipRfValidation && !(((freq >= 150.0) && (freq <= 960.0)) || +int16_t LR1120::setFrequency(float freq, bool skipCalibration, float band) { +#if RADIOLIB_CHECK_PARAMS + if(!(((freq >= 150.0) && (freq <= 960.0)) || ((freq >= 1900.0) && (freq <= 2200.0)) || ((freq >= 2400.0) && (freq <= 2500.0)))) { return(RADIOLIB_ERR_INVALID_FREQUENCY); } +#endif // check if we need to recalibrate image int16_t state;