From 5dfa0d66fba97365ab72f24828e319cf196cf597 Mon Sep 17 00:00:00 2001 From: Amalinda Date: Sun, 29 Oct 2023 20:55:40 +0800 Subject: [PATCH] symbolNumValues[6] array no longer needed as we will utilize only two symbol CAD operations for all SFs. --- src/modules/SX126x/SX126x.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index 560e5e4e..7c6f8baa 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -1706,12 +1706,6 @@ int16_t SX126x::setRx(uint32_t timeout) { int16_t SX126x::setCad(uint8_t symbolNum, uint8_t detPeak, uint8_t detMin) { // default CAD parameters are shown in Semtech AN1200.48, page 41. uint8_t detPeakValues[6] = { 22, 22, 24, 25, 26, 30}; - uint8_t symbolNumValues[6] = { RADIOLIB_SX126X_CAD_ON_2_SYMB, - RADIOLIB_SX126X_CAD_ON_2_SYMB, - RADIOLIB_SX126X_CAD_ON_2_SYMB, - RADIOLIB_SX126X_CAD_ON_2_SYMB, - RADIOLIB_SX126X_CAD_ON_2_SYMB, - RADIOLIB_SX126X_CAD_ON_2_SYMB }; // CAD parameters aren't available for SF-6. Just to be safe. if(this->spreadingFactor < 7) { @@ -1722,7 +1716,7 @@ int16_t SX126x::setCad(uint8_t symbolNum, uint8_t detPeak, uint8_t detMin) { // build the packet uint8_t data[7]; - data[0] = symbolNumValues[this->spreadingFactor - 7]; + data[0] = RADIOLIB_SX126X_CAD_ON_2_SYMB; data[1] = detPeakValues[this->spreadingFactor - 7]; data[2] = RADIOLIB_SX126X_CAD_PARAM_DET_MIN; data[3] = RADIOLIB_SX126X_CAD_GOTO_STDBY;