From 6fb96a135fa68ca8b8f9b3a0192f4bbab80491ec Mon Sep 17 00:00:00 2001 From: Oliver <107413444+OlliLausS@users.noreply.github.com> Date: Sun, 7 Jul 2024 21:44:33 +0200 Subject: [PATCH] Update CC1101.cpp Update of error handling --- src/modules/CC1101/CC1101.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/CC1101/CC1101.cpp b/src/modules/CC1101/CC1101.cpp index 7170e8f8..7d08ac7a 100644 --- a/src/modules/CC1101/CC1101.cpp +++ b/src/modules/CC1101/CC1101.cpp @@ -471,7 +471,7 @@ int16_t CC1101::setBitRate(float br) { } int16_t CC1101::setBitRateTolerance(uint8_t brt) { - RADIOLIB_CHECK_RANGE(brt, 0x00, 0x03, RADIOLIB_ERR_INVALID_BIT_RATE_TOLERANCE_VALUE); + if (brt > 0x03) return (RADIOLIB_ERR_INVALID_BIT_RATE_TOLERANCE_VALUE); // Set Bit Rate tolerance int16_t state = SPIsetRegValue(RADIOLIB_CC1101_REG_BSCFG, brt, 1, 0);