From 84402968c20efbf47fb6e24b0be056bf38cef67f Mon Sep 17 00:00:00 2001 From: lewisxhe Date: Sat, 25 May 2024 10:50:58 +0800 Subject: [PATCH] Fixed SX128X checkOutputPower --- src/modules/SX128x/SX128x.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/SX128x/SX128x.cpp b/src/modules/SX128x/SX128x.cpp index a51ae78c..3132f26f 100644 --- a/src/modules/SX128x/SX128x.cpp +++ b/src/modules/SX128x/SX128x.cpp @@ -792,11 +792,11 @@ int16_t SX128x::setOutputPower(int8_t pwr) { return(setTxParams(this->power)); } -int16_t SX128x::checkOutputPower(int8_t power, int8_t* clipped) { +int16_t SX128x::checkOutputPower(int8_t pwr, int8_t* clipped) { if(clipped) { - *clipped = RADIOLIB_MAX(-18, RADIOLIB_MIN(13, power)); + *clipped = RADIOLIB_MAX(-18, RADIOLIB_MIN(13, pwr)); } - RADIOLIB_CHECK_RANGE(power, -18, 13, RADIOLIB_ERR_INVALID_OUTPUT_POWER); + RADIOLIB_CHECK_RANGE(pwr, -18, 13, RADIOLIB_ERR_INVALID_OUTPUT_POWER); return(RADIOLIB_ERR_NONE); }