From 6c114804169ee65863447de53c4903b538ebed84 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 26 May 2024 08:49:02 +0200 Subject: [PATCH] [LR11x0] Cppcheck cleanup --- src/modules/LR11x0/LR11x0.cpp | 6 +++--- src/modules/LR11x0/LR11x0.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/LR11x0/LR11x0.cpp b/src/modules/LR11x0/LR11x0.cpp index 1e5fe5b8..7c61568f 100644 --- a/src/modules/LR11x0/LR11x0.cpp +++ b/src/modules/LR11x0/LR11x0.cpp @@ -1573,7 +1573,7 @@ int16_t LR11x0::updateFirmware(const uint32_t* image, size_t size, bool nonvolat state = this->getVersion(NULL, &device, NULL, NULL); RADIOLIB_ASSERT(state); if(device != RADIOLIB_LR11X0_DEVICE_BOOT) { - RADIOLIB_DEBUG_BASIC_PRINTLN("Failed to put device to bootloader mode, %02x != %02x", device, RADIOLIB_LR11X0_DEVICE_BOOT); + RADIOLIB_DEBUG_BASIC_PRINTLN("Failed to put device to bootloader mode, %02x != %02x", (unsigned int)device, (unsigned int)RADIOLIB_LR11X0_DEVICE_BOOT); return(RADIOLIB_ERR_CHIP_NOT_FOUND); } @@ -1611,7 +1611,7 @@ int16_t LR11x0::updateFirmware(const uint32_t* image, size_t size, bool nonvolat state = this->getVersion(NULL, &device, NULL, NULL); RADIOLIB_ASSERT(state); if(device == RADIOLIB_LR11X0_DEVICE_BOOT) { - RADIOLIB_DEBUG_BASIC_PRINTLN("Failed to kick device from bootloader mode, %02x == %02x", device, RADIOLIB_LR11X0_DEVICE_BOOT); + RADIOLIB_DEBUG_BASIC_PRINTLN("Failed to kick device from bootloader mode, %02x == %02x", (unsigned int)device, (unsigned int)RADIOLIB_LR11X0_DEVICE_BOOT); return(RADIOLIB_ERR_CHIP_NOT_FOUND); } @@ -2487,7 +2487,7 @@ int16_t LR11x0::setRangingParameter(uint8_t symbolNum) { return(this->SPIcommand(RADIOLIB_LR11X0_CMD_SET_RANGING_PARAMETER, true, buff, sizeof(buff))); } -int16_t LR11x0::setRssiCalibration(int8_t* tune, int16_t gainOffset) { +int16_t LR11x0::setRssiCalibration(const int8_t* tune, int16_t gainOffset) { uint8_t buff[11] = { (uint8_t)((tune[0] & 0x0F) | (uint8_t)(tune[1] & 0x0F) << 4), (uint8_t)((tune[2] & 0x0F) | (uint8_t)(tune[3] & 0x0F) << 4), diff --git a/src/modules/LR11x0/LR11x0.h b/src/modules/LR11x0/LR11x0.h index 7ba95a98..1f87df81 100644 --- a/src/modules/LR11x0/LR11x0.h +++ b/src/modules/LR11x0/LR11x0.h @@ -1418,7 +1418,7 @@ class LR11x0: public PhysicalLayer { int16_t setGfskWhitParams(uint16_t seed); int16_t setRxBoosted(bool en); int16_t setRangingParameter(uint8_t symbolNum); - int16_t setRssiCalibration(int8_t* tune, int16_t gainOffset); + int16_t setRssiCalibration(const int8_t* tune, int16_t gainOffset); int16_t setLoRaSyncWord(uint8_t sync); int16_t lrFhssBuildFrame(uint8_t hdrCount, uint8_t cr, uint8_t grid, bool hop, uint8_t bw, uint16_t hopSeq, int8_t devOffset, uint8_t* payload, size_t len); int16_t lrFhssSetSyncWord(uint32_t sync);