add RADIOLIB_CHECK_PARAMS

This commit is contained in:
Yegor Shytikov 2025-01-14 09:33:17 -08:00 committed by GitHub
parent 25cc487b14
commit b6964901cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,12 +50,14 @@ int16_t LR1120::setFrequency(float freq) {
return(this->setFrequency(freq, false)); return(this->setFrequency(freq, false));
} }
int16_t LR1120::setFrequency(float freq, bool skipCalibration, float band, bool skipRfValidation) { int16_t LR1120::setFrequency(float freq, bool skipCalibration, float band) {
if(!skipRfValidation && !(((freq >= 150.0) && (freq <= 960.0)) || #if RADIOLIB_CHECK_PARAMS
if(!(((freq >= 150.0) && (freq <= 960.0)) ||
((freq >= 1900.0) && (freq <= 2200.0)) || ((freq >= 1900.0) && (freq <= 2200.0)) ||
((freq >= 2400.0) && (freq <= 2500.0)))) { ((freq >= 2400.0) && (freq <= 2500.0)))) {
return(RADIOLIB_ERR_INVALID_FREQUENCY); return(RADIOLIB_ERR_INVALID_FREQUENCY);
} }
#endif
// check if we need to recalibrate image // check if we need to recalibrate image
int16_t state; int16_t state;