diff --git a/coverage/extras/test/unit/include/HardwareEmulation.hpp.func-sort-c.html b/coverage/extras/test/unit/include/HardwareEmulation.hpp.func-sort-c.html index 30e352f1..5e45a4d8 100644 --- a/coverage/extras/test/unit/include/HardwareEmulation.hpp.func-sort-c.html +++ b/coverage/extras/test/unit/include/HardwareEmulation.hpp.func-sort-c.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 3 @@ -65,11 +65,11 @@ _ZN13EmulatedRadio10HandleGPIOEv - 2934 + 2932 _ZN13EmulatedRadio9HandleSPIEh - 4197 + 4192
diff --git a/coverage/extras/test/unit/include/HardwareEmulation.hpp.func.html b/coverage/extras/test/unit/include/HardwareEmulation.hpp.func.html index b8a6fdaf..964ed8a0 100644 --- a/coverage/extras/test/unit/include/HardwareEmulation.hpp.func.html +++ b/coverage/extras/test/unit/include/HardwareEmulation.hpp.func.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 3 @@ -61,7 +61,7 @@ _ZN13EmulatedRadio10HandleGPIOEv - 2934 + 2932 _ZN13EmulatedRadio7connectEP13EmulatedPin_tS1_S1_S1_ @@ -69,7 +69,7 @@ _ZN13EmulatedRadio9HandleSPIEh - 4197 + 4192
diff --git a/coverage/extras/test/unit/include/HardwareEmulation.hpp.gcov.html b/coverage/extras/test/unit/include/HardwareEmulation.hpp.gcov.html index 86fdd608..7099fc30 100644 --- a/coverage/extras/test/unit/include/HardwareEmulation.hpp.gcov.html +++ b/coverage/extras/test/unit/include/HardwareEmulation.hpp.gcov.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 3 @@ -111,15 +111,15 @@ 49 4 : this->gpio->func = PIN_GPIO; 50 4 : } 51 : - 52 4197 : virtual uint8_t HandleSPI(uint8_t b) { + 52 4192 : virtual uint8_t HandleSPI(uint8_t b) { 53 : (void)b; 54 : // handle the SPI input and generate output here - 55 4197 : return(EMULATED_RADIO_SPI_RETURN); + 55 4192 : return(EMULATED_RADIO_SPI_RETURN); 56 : } 57 : - 58 2934 : virtual void HandleGPIO() { + 58 2932 : virtual void HandleGPIO() { 59 : // handle discrete GPIO signals here (e.g. reset state machine on NSS falling edge) - 60 2934 : } + 60 2932 : } 61 : 62 : protected: 63 : // pointers to emulated GPIO pins diff --git a/coverage/extras/test/unit/include/TestHal.hpp.func-sort-c.html b/coverage/extras/test/unit/include/TestHal.hpp.func-sort-c.html index 8e6f30ef..0db93725 100644 --- a/coverage/extras/test/unit/include/TestHal.hpp.func-sort-c.html +++ b/coverage/extras/test/unit/include/TestHal.hpp.func-sort-c.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 15 @@ -125,35 +125,35 @@ _ZN7TestHal11digitalReadEj - 848 + 846 _ZN7TestHal6millisEv - 848 + 846 _ZN7TestHal6microsEv - 1463 + 1462 _ZN7TestHal11spiTransferEPhmS0_ - 1465 + 1464 _ZN7TestHal17spiEndTransactionEv - 1465 + 1464 _ZN7TestHal19spiBeginTransactionEv - 1465 + 1464 _ZN7TestHal12digitalWriteEjj - 2934 + 2932 _ZN7TestHal17delayMicrosecondsEm - 4621 + 4615
diff --git a/coverage/extras/test/unit/include/TestHal.hpp.func.html b/coverage/extras/test/unit/include/TestHal.hpp.func.html index fc805e05..650b3084 100644 --- a/coverage/extras/test/unit/include/TestHal.hpp.func.html +++ b/coverage/extras/test/unit/include/TestHal.hpp.func.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 15 @@ -65,11 +65,11 @@ _ZN7TestHal11digitalReadEj - 848 + 846 _ZN7TestHal11spiTransferEPhmS0_ - 1465 + 1464 _ZN7TestHal12connectRadioEP13EmulatedRadio @@ -77,7 +77,7 @@ _ZN7TestHal12digitalWriteEjj - 2934 + 2932 _ZN7TestHal12spiLogMemcmpEPKvm @@ -93,15 +93,15 @@ _ZN7TestHal17delayMicrosecondsEm - 4621 + 4615 _ZN7TestHal17spiEndTransactionEv - 1465 + 1464 _ZN7TestHal19spiBeginTransactionEv - 1465 + 1464 _ZN7TestHal4initEv @@ -125,11 +125,11 @@ _ZN7TestHal6microsEv - 1463 + 1462 _ZN7TestHal6millisEv - 848 + 846 _ZN7TestHal6noToneEj diff --git a/coverage/extras/test/unit/include/TestHal.hpp.gcov.html b/coverage/extras/test/unit/include/TestHal.hpp.gcov.html index cfb40b26..887b88aa 100644 --- a/coverage/extras/test/unit/include/TestHal.hpp.gcov.html +++ b/coverage/extras/test/unit/include/TestHal.hpp.gcov.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 15 @@ -131,40 +131,40 @@ 69 4 : this->gpio[pin].mode = mode; 70 4 : } 71 : - 72 2934 : void digitalWrite(uint32_t pin, uint32_t value) override { + 72 2932 : void digitalWrite(uint32_t pin, uint32_t value) override { 73 : HAL_LOG("TestHal::digitalWrite(pin=" << pin << ", value=" << value << " [" << ((value == TEST_HAL_LOW) ? "LOW" : "HIGH") << "])"); 74 : 75 : // check the range - 76 2934 : BOOST_ASSERT_MSG(pin < TEST_HAL_NUM_GPIO_PINS, "Pin number out of range"); + 76 2932 : BOOST_ASSERT_MSG(pin < TEST_HAL_NUM_GPIO_PINS, "Pin number out of range"); 77 : 78 : // check it is output - 79 2934 : BOOST_ASSERT_MSG(this->gpio[pin].mode == TEST_HAL_OUTPUT, "GPIO is not output!"); + 79 2932 : BOOST_ASSERT_MSG(this->gpio[pin].mode == TEST_HAL_OUTPUT, "GPIO is not output!"); 80 : 81 : // check known values - 82 2934 : BOOST_ASSERT_MSG(((value == TEST_HAL_LOW) || (value == TEST_HAL_HIGH)), "Invalid output value"); + 82 2932 : BOOST_ASSERT_MSG(((value == TEST_HAL_LOW) || (value == TEST_HAL_HIGH)), "Invalid output value"); 83 : 84 : // set value - 85 2934 : this->gpio[pin].value = value; - 86 2934 : this->gpio[pin].event = true; - 87 2934 : if(radio) { - 88 2934 : this->radio->HandleGPIO(); + 85 2932 : this->gpio[pin].value = value; + 86 2932 : this->gpio[pin].event = true; + 87 2932 : if(radio) { + 88 2932 : this->radio->HandleGPIO(); 89 : } - 90 2934 : this->gpio[pin].event = false; - 91 2934 : } + 90 2932 : this->gpio[pin].event = false; + 91 2932 : } 92 : - 93 848 : uint32_t digitalRead(uint32_t pin) override { + 93 846 : uint32_t digitalRead(uint32_t pin) override { 94 : HAL_LOG("TestHal::digitalRead(pin=" << pin << ")"); 95 : 96 : // check the range - 97 848 : BOOST_ASSERT_MSG(pin < TEST_HAL_NUM_GPIO_PINS, "Pin number out of range"); + 97 846 : BOOST_ASSERT_MSG(pin < TEST_HAL_NUM_GPIO_PINS, "Pin number out of range"); 98 : 99 : // check it is input - 100 848 : BOOST_ASSERT_MSG(this->gpio[pin].mode == TEST_HAL_INPUT, "GPIO is not input"); + 100 846 : BOOST_ASSERT_MSG(this->gpio[pin].mode == TEST_HAL_INPUT, "GPIO is not input"); 101 : 102 : // read the value - 103 848 : uint32_t value = this->gpio[pin].value; + 103 846 : uint32_t value = this->gpio[pin].value; 104 : HAL_LOG("TestHal::digitalRead(pin=" << pin << ")=" << value << " [" << ((value == TEST_HAL_LOW) ? "LOW" : "HIGH") << "]"); - 105 848 : return(value); + 105 846 : return(value); 106 : } 107 : 108 0 : void attachInterrupt(uint32_t interruptNum, void (*interruptCb)(void), uint32_t mode) override { @@ -196,38 +196,38 @@ 134 : HAL_LOG("TestHal::delay(ms=" << ms << ")=" << elapsed.count() << "ms"); 135 0 : } 136 : - 137 4621 : void delayMicroseconds(unsigned long us) override { + 137 4615 : void delayMicroseconds(unsigned long us) override { 138 : HAL_LOG("TestHal::delayMicroseconds(us=" << us << ")"); - 139 4621 : const auto start = std::chrono::high_resolution_clock::now(); + 139 4615 : const auto start = std::chrono::high_resolution_clock::now(); 140 : 141 : // busy wait is needed for microseconds precision - 142 4621 : const auto len = std::chrono::microseconds(us); - 143 6717169 : while(std::chrono::high_resolution_clock::now() - start < len); + 142 4615 : const auto len = std::chrono::microseconds(us); + 143 6663291 : while(std::chrono::high_resolution_clock::now() - start < len); 144 : 145 : // measure and print - 146 4621 : const auto end = std::chrono::high_resolution_clock::now(); - 147 4621 : const std::chrono::duration<double, std::micro> elapsed = end - start; + 146 4615 : const auto end = std::chrono::high_resolution_clock::now(); + 147 4615 : const std::chrono::duration<double, std::micro> elapsed = end - start; 148 : HAL_LOG("TestHal::delayMicroseconds(us=" << us << ")=" << elapsed.count() << "us"); - 149 4621 : } + 149 4615 : } 150 : 151 0 : void yield() override { 152 : HAL_LOG("TestHal::yield()"); 153 0 : } 154 : - 155 848 : unsigned long millis() override { + 155 846 : unsigned long millis() override { 156 : HAL_LOG("TestHal::millis()"); - 157 848 : std::chrono::time_point now = std::chrono::high_resolution_clock::now(); - 158 848 : auto res = std::chrono::duration_cast<std::chrono::milliseconds>(now - this->start); + 157 846 : std::chrono::time_point now = std::chrono::high_resolution_clock::now(); + 158 846 : auto res = std::chrono::duration_cast<std::chrono::milliseconds>(now - this->start); 159 : HAL_LOG("TestHal::millis()=" << res.count()); - 160 848 : return(res.count()); + 160 846 : return(res.count()); 161 : } 162 : - 163 1463 : unsigned long micros() override { + 163 1462 : unsigned long micros() override { 164 : HAL_LOG("TestHal::micros()"); - 165 1463 : std::chrono::time_point now = std::chrono::high_resolution_clock::now(); - 166 1463 : auto res = std::chrono::duration_cast<std::chrono::microseconds>(now - this->start); + 165 1462 : std::chrono::time_point now = std::chrono::high_resolution_clock::now(); + 166 1462 : auto res = std::chrono::duration_cast<std::chrono::microseconds>(now - this->start); 167 : HAL_LOG("TestHal::micros()=" << res.count()); - 168 1463 : return(res.count()); + 168 1462 : return(res.count()); 169 : } 170 : 171 0 : long pulseIn(uint32_t pin, uint32_t state, unsigned long timeout) override { @@ -244,33 +244,33 @@ 182 : HAL_LOG("TestHal::spiBegin()"); 183 0 : } 184 : - 185 1465 : void spiBeginTransaction() { + 185 1464 : void spiBeginTransaction() { 186 : HAL_LOG("TestHal::spiBeginTransaction()"); - 187 1465 : } + 187 1464 : } 188 : - 189 1465 : void spiTransfer(uint8_t* out, size_t len, uint8_t* in) { + 189 1464 : void spiTransfer(uint8_t* out, size_t len, uint8_t* in) { 190 : HAL_LOG("TestHal::spiTransfer(len=" << len << ")"); 191 : - 192 5662 : for(size_t i = 0; i < len; i++) { + 192 5656 : for(size_t i = 0; i < len; i++) { 193 : // append to log - 194 4197 : (*this->spiLogPtr++) = out[i]; + 194 4192 : (*this->spiLogPtr++) = out[i]; 195 : 196 : // process the SPI byte - 197 4197 : in[i] = this->radio->HandleSPI(out[i]); + 197 4192 : in[i] = this->radio->HandleSPI(out[i]); 198 : 199 : // artificial delay to emulate SPI running at a finite speed 200 : // this is added because timeouts are based on time duration, 201 : // so we need to make sure some time actually elapses - 202 4197 : this->delayMicroseconds(100); + 202 4192 : this->delayMicroseconds(100); 203 : 204 : // output debug 205 : HAL_LOG(fmt::format("out={:#02x}, in={:#02x}", out[i], in[i])); 206 : } - 207 1465 : } + 207 1464 : } 208 : - 209 1465 : void spiEndTransaction() { + 209 1464 : void spiEndTransaction() { 210 : HAL_LOG("TestHal::spiEndTransaction()"); - 211 1465 : } + 211 1464 : } 212 : 213 0 : void spiEnd() { 214 : HAL_LOG("TestHal::spiEnd()"); diff --git a/coverage/extras/test/unit/include/index-sort-f.html b/coverage/extras/test/unit/include/index-sort-f.html index 946273ed..947ed5ad 100644 --- a/coverage/extras/test/unit/include/index-sort-f.html +++ b/coverage/extras/test/unit/include/index-sort-f.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 18 diff --git a/coverage/extras/test/unit/include/index-sort-l.html b/coverage/extras/test/unit/include/index-sort-l.html index 22b37ac6..16a181e8 100644 --- a/coverage/extras/test/unit/include/index-sort-l.html +++ b/coverage/extras/test/unit/include/index-sort-l.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 18 diff --git a/coverage/extras/test/unit/include/index.html b/coverage/extras/test/unit/include/index.html index 70e73d94..daa2b171 100644 --- a/coverage/extras/test/unit/include/index.html +++ b/coverage/extras/test/unit/include/index.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 18 diff --git a/coverage/extras/test/unit/tests/TestModule.cpp.func-sort-c.html b/coverage/extras/test/unit/tests/TestModule.cpp.func-sort-c.html index 38282f0d..6ff4ea1a 100644 --- a/coverage/extras/test/unit/tests/TestModule.cpp.func-sort-c.html +++ b/coverage/extras/test/unit/tests/TestModule.cpp.func-sort-c.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 10 diff --git a/coverage/extras/test/unit/tests/TestModule.cpp.func.html b/coverage/extras/test/unit/tests/TestModule.cpp.func.html index 9f2c4198..2ae6b663 100644 --- a/coverage/extras/test/unit/tests/TestModule.cpp.func.html +++ b/coverage/extras/test/unit/tests/TestModule.cpp.func.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 10 diff --git a/coverage/extras/test/unit/tests/TestModule.cpp.gcov.html b/coverage/extras/test/unit/tests/TestModule.cpp.gcov.html index 1d6ac05e..66501585 100644 --- a/coverage/extras/test/unit/tests/TestModule.cpp.gcov.html +++ b/coverage/extras/test/unit/tests/TestModule.cpp.gcov.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 10 diff --git a/coverage/extras/test/unit/tests/index-sort-f.html b/coverage/extras/test/unit/tests/index-sort-f.html index 93837c5d..5d317755 100644 --- a/coverage/extras/test/unit/tests/index-sort-f.html +++ b/coverage/extras/test/unit/tests/index-sort-f.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 10 diff --git a/coverage/extras/test/unit/tests/index-sort-l.html b/coverage/extras/test/unit/tests/index-sort-l.html index e228a9c7..8f4de5fe 100644 --- a/coverage/extras/test/unit/tests/index-sort-l.html +++ b/coverage/extras/test/unit/tests/index-sort-l.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 10 diff --git a/coverage/extras/test/unit/tests/index.html b/coverage/extras/test/unit/tests/index.html index 0f10dc98..a5ba15e6 100644 --- a/coverage/extras/test/unit/tests/index.html +++ b/coverage/extras/test/unit/tests/index.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 10 diff --git a/coverage/index-sort-f.html b/coverage/index-sort-f.html index bb808ad9..7619f0f1 100644 --- a/coverage/index-sort-f.html +++ b/coverage/index-sort-f.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 38 diff --git a/coverage/index-sort-l.html b/coverage/index-sort-l.html index 08a25588..e5869b64 100644 --- a/coverage/index-sort-l.html +++ b/coverage/index-sort-l.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 38 diff --git a/coverage/index.html b/coverage/index.html index c830fe9c..170d5a73 100644 --- a/coverage/index.html +++ b/coverage/index.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 38 diff --git a/coverage/src/Hal.cpp.func-sort-c.html b/coverage/src/Hal.cpp.func-sort-c.html index 1fbe3820..1740ac65 100644 --- a/coverage/src/Hal.cpp.func-sort-c.html +++ b/coverage/src/Hal.cpp.func-sort-c.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 1 diff --git a/coverage/src/Hal.cpp.func.html b/coverage/src/Hal.cpp.func.html index 0ee6e8d7..81b99e98 100644 --- a/coverage/src/Hal.cpp.func.html +++ b/coverage/src/Hal.cpp.func.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 1 diff --git a/coverage/src/Hal.cpp.gcov.html b/coverage/src/Hal.cpp.gcov.html index 080abb18..90f8e877 100644 --- a/coverage/src/Hal.cpp.gcov.html +++ b/coverage/src/Hal.cpp.gcov.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 1 diff --git a/coverage/src/Module.cpp.func-sort-c.html b/coverage/src/Module.cpp.func-sort-c.html index 75de53d6..1a77e003 100644 --- a/coverage/src/Module.cpp.func-sort-c.html +++ b/coverage/src/Module.cpp.func-sort-c.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 9 @@ -141,7 +141,7 @@ _ZN6Module17SPItransferStreamEPKhhbS1_Phmb - 424 + 423 _ZN6Module11SPItransferEtjPKhPhm @@ -149,7 +149,7 @@ _ZN6Module15SPIreadRegisterEj - 1455 + 1454
diff --git a/coverage/src/Module.cpp.func.html b/coverage/src/Module.cpp.func.html index 17496cf8..334d9d15 100644 --- a/coverage/src/Module.cpp.func.html +++ b/coverage/src/Module.cpp.func.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 9 @@ -93,7 +93,7 @@ _ZN6Module15SPIreadRegisterEj - 1455 + 1454 _ZN6Module15setRfSwitchPinsEjj @@ -113,7 +113,7 @@ _ZN6Module17SPItransferStreamEPKhhbS1_Phmb - 424 + 423 _ZN6Module19waitForMicrosecondsEmm diff --git a/coverage/src/Module.cpp.gcov.html b/coverage/src/Module.cpp.gcov.html index e66dc3f1..410dc8b6 100644 --- a/coverage/src/Module.cpp.gcov.html +++ b/coverage/src/Module.cpp.gcov.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 9 @@ -143,9 +143,9 @@ 81 : #if RADIOLIB_DEBUG_SPI 82 : uint8_t readValue = 0x00; 83 : #endif - 84 1449 : while(this->hal->micros() - start < (checkInterval * 1000)) { - 85 1441 : uint8_t val = SPIreadRegister(reg); - 86 1441 : if((val & checkMask) == (newValue & checkMask)) { + 84 1448 : while(this->hal->micros() - start < (checkInterval * 1000)) { + 85 1440 : uint8_t val = SPIreadRegister(reg); + 86 1440 : if((val & checkMask) == (newValue & checkMask)) { 87 : // check passed, we can stop the loop 88 2 : return(RADIOLIB_ERR_NONE); 89 : } @@ -186,22 +186,22 @@ 124 : } 125 0 : } 126 : - 127 1455 : uint8_t Module::SPIreadRegister(uint32_t reg) { - 128 1455 : uint8_t resp = 0; - 129 1455 : if(!spiConfig.stream) { + 127 1454 : uint8_t Module::SPIreadRegister(uint32_t reg) { + 128 1454 : uint8_t resp = 0; + 129 1454 : if(!spiConfig.stream) { 130 1036 : SPItransfer(this->spiConfig.cmds[RADIOLIB_MODULE_SPI_COMMAND_READ], reg, NULL, &resp, 1); 131 : } else { 132 : uint8_t cmd[6]; - 133 419 : uint8_t* cmdPtr = cmd; - 134 838 : for(int8_t i = (int8_t)this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_CMD]/8 - 1; i >= 0; i--) { - 135 419 : *(cmdPtr++) = (this->spiConfig.cmds[RADIOLIB_MODULE_SPI_COMMAND_READ] >> 8*i) & 0xFF; + 133 418 : uint8_t* cmdPtr = cmd; + 134 836 : for(int8_t i = (int8_t)this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_CMD]/8 - 1; i >= 0; i--) { + 135 418 : *(cmdPtr++) = (this->spiConfig.cmds[RADIOLIB_MODULE_SPI_COMMAND_READ] >> 8*i) & 0xFF; 136 : } - 137 1257 : for(int8_t i = (int8_t)((this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_ADDR]/8) - 1); i >= 0; i--) { - 138 838 : *(cmdPtr++) = (reg >> 8*i) & 0xFF; + 137 1254 : for(int8_t i = (int8_t)((this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_ADDR]/8) - 1); i >= 0; i--) { + 138 836 : *(cmdPtr++) = (reg >> 8*i) & 0xFF; 139 : } - 140 419 : SPItransferStream(cmd, this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_CMD]/8 + this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_ADDR]/8, false, NULL, &resp, 1, true); + 140 418 : SPItransferStream(cmd, this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_CMD]/8 + this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_ADDR]/8, false, NULL, &resp, 1, true); 141 : } - 142 1455 : return(resp); + 142 1454 : return(resp); 143 : } 144 : 145 0 : void Module::SPIwriteRegisterBurst(uint32_t reg, const uint8_t* data, size_t numBytes) { @@ -377,38 +377,38 @@ 315 0 : return(state); 316 : } 317 : - 318 424 : int16_t Module::SPItransferStream(const uint8_t* cmd, uint8_t cmdLen, bool write, const uint8_t* dataOut, uint8_t* dataIn, size_t numBytes, bool waitForGpio) { + 318 423 : int16_t Module::SPItransferStream(const uint8_t* cmd, uint8_t cmdLen, bool write, const uint8_t* dataOut, uint8_t* dataIn, size_t numBytes, bool waitForGpio) { 319 : // prepare the output buffer - 320 424 : size_t buffLen = cmdLen + numBytes; - 321 424 : if(!write) { - 322 419 : buffLen += (this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_STATUS] / 8); + 320 423 : size_t buffLen = cmdLen + numBytes; + 321 423 : if(!write) { + 322 418 : buffLen += (this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_STATUS] / 8); 323 : } 324 : #if RADIOLIB_STATIC_ONLY 325 : uint8_t buffOut[RADIOLIB_STATIC_ARRAY_SIZE]; 326 : #else - 327 424 : uint8_t* buffOut = new uint8_t[buffLen]; + 327 423 : uint8_t* buffOut = new uint8_t[buffLen]; 328 : #endif - 329 424 : uint8_t* buffOutPtr = buffOut; + 329 423 : uint8_t* buffOutPtr = buffOut; 330 : 331 : // copy the command - 332 1696 : for(uint8_t n = 0; n < cmdLen; n++) { - 333 1272 : *(buffOutPtr++) = cmd[n]; + 332 1692 : for(uint8_t n = 0; n < cmdLen; n++) { + 333 1269 : *(buffOutPtr++) = cmd[n]; 334 : } 335 : 336 : // copy the data - 337 424 : if(write) { + 337 423 : if(write) { 338 5 : memcpy(buffOutPtr, dataOut, numBytes); 339 : } else { - 340 419 : memset(buffOutPtr, this->spiConfig.cmds[RADIOLIB_MODULE_SPI_COMMAND_NOP], numBytes + (this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_STATUS] / 8)); + 340 418 : memset(buffOutPtr, this->spiConfig.cmds[RADIOLIB_MODULE_SPI_COMMAND_NOP], numBytes + (this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_STATUS] / 8)); 341 : } 342 : 343 : // ensure GPIO is low - 344 424 : if(waitForGpio) { - 345 424 : if(this->gpioPin == RADIOLIB_NC) { + 344 423 : if(waitForGpio) { + 345 423 : if(this->gpioPin == RADIOLIB_NC) { 346 0 : this->hal->delay(50); 347 : } else { - 348 424 : RadioLibTime_t start = this->hal->millis(); - 349 424 : while(this->hal->digitalRead(this->gpioPin)) { + 348 423 : RadioLibTime_t start = this->hal->millis(); + 349 423 : while(this->hal->digitalRead(this->gpioPin)) { 350 0 : this->hal->yield(); 351 : 352 : // this timeout check triggers a false positive from cppcheck @@ -429,24 +429,24 @@ 367 : #if RADIOLIB_STATIC_ONLY 368 : uint8_t buffIn[RADIOLIB_STATIC_ARRAY_SIZE]; 369 : #else - 370 424 : uint8_t* buffIn = new uint8_t[buffLen]; + 370 423 : uint8_t* buffIn = new uint8_t[buffLen]; 371 : #endif 372 : 373 : // do the transfer - 374 424 : this->hal->spiBeginTransaction(); - 375 424 : this->hal->digitalWrite(this->csPin, this->hal->GpioLevelLow); - 376 424 : this->hal->spiTransfer(buffOut, buffLen, buffIn); - 377 424 : this->hal->digitalWrite(this->csPin, this->hal->GpioLevelHigh); - 378 424 : this->hal->spiEndTransaction(); + 374 423 : this->hal->spiBeginTransaction(); + 375 423 : this->hal->digitalWrite(this->csPin, this->hal->GpioLevelLow); + 376 423 : this->hal->spiTransfer(buffOut, buffLen, buffIn); + 377 423 : this->hal->digitalWrite(this->csPin, this->hal->GpioLevelHigh); + 378 423 : this->hal->spiEndTransaction(); 379 : 380 : // wait for GPIO to go high and then low - 381 424 : if(waitForGpio) { - 382 424 : if(this->gpioPin == RADIOLIB_NC) { + 381 423 : if(waitForGpio) { + 382 423 : if(this->gpioPin == RADIOLIB_NC) { 383 0 : this->hal->delay(1); 384 : } else { - 385 424 : this->hal->delayMicroseconds(1); - 386 424 : RadioLibTime_t start = this->hal->millis(); - 387 424 : while(this->hal->digitalRead(this->gpioPin)) { + 385 423 : this->hal->delayMicroseconds(1); + 386 423 : RadioLibTime_t start = this->hal->millis(); + 387 423 : while(this->hal->digitalRead(this->gpioPin)) { 388 0 : this->hal->yield(); 389 : 390 : // this timeout check triggers a false positive from cppcheck @@ -465,15 +465,15 @@ 403 : } 404 : 405 : // parse status - 406 424 : int16_t state = RADIOLIB_ERR_NONE; - 407 424 : if((this->spiConfig.parseStatusCb != nullptr) && (numBytes > 0)) { + 406 423 : int16_t state = RADIOLIB_ERR_NONE; + 407 423 : if((this->spiConfig.parseStatusCb != nullptr) && (numBytes > 0)) { 408 0 : state = this->spiConfig.parseStatusCb(buffIn[this->spiConfig.statusPos]); 409 : } 410 : 411 : // copy the data - 412 424 : if(!write) { + 412 423 : if(!write) { 413 : // skip the status bytes if present - 414 419 : memcpy(dataIn, &buffIn[cmdLen + (this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_STATUS] / 8)], numBytes); + 414 418 : memcpy(dataIn, &buffIn[cmdLen + (this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_STATUS] / 8)], numBytes); 415 : } 416 : 417 : // print debug information @@ -508,11 +508,11 @@ 446 : #endif 447 : 448 : #if !RADIOLIB_STATIC_ONLY - 449 424 : delete[] buffOut; - 450 424 : delete[] buffIn; + 449 423 : delete[] buffOut; + 450 423 : delete[] buffIn; 451 : #endif 452 : - 453 424 : return(state); + 453 423 : return(state); 454 : } 455 : 456 0 : void Module::waitForMicroseconds(RadioLibTime_t start, RadioLibTime_t len) { diff --git a/coverage/src/index-sort-f.html b/coverage/src/index-sort-f.html index 70fe7b00..d265e833 100644 --- a/coverage/src/index-sort-f.html +++ b/coverage/src/index-sort-f.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 10 diff --git a/coverage/src/index-sort-l.html b/coverage/src/index-sort-l.html index 99b9af87..fb7b89d8 100644 --- a/coverage/src/index-sort-l.html +++ b/coverage/src/index-sort-l.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 10 diff --git a/coverage/src/index.html b/coverage/src/index.html index ca583129..91c7516a 100644 --- a/coverage/src/index.html +++ b/coverage/src/index.html @@ -37,7 +37,7 @@ Date: - 2025-02-19 18:47:57 + 2025-02-27 17:17:27 Functions: 10