diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index d56681412..5b88d45ed 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -129,6 +129,7 @@ bool RF95Interface::reconfigure() if (power > MAX_POWER) // This chip has lower power limits than some power = MAX_POWER; + err = lora->setOutputPower(power); if (err != RADIOLIB_ERR_NONE) RECORD_CRITICALERROR(CriticalErrorCode_INVALID_RADIO_SETTING); diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index 64758cd0d..257d8fd04 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -144,8 +144,9 @@ bool SX126xInterface::reconfigure() if (err != RADIOLIB_ERR_NONE) RECORD_CRITICALERROR(CriticalErrorCode_INVALID_RADIO_SETTING); - if (power > 22) // This chip has lower power limits than some - power = 22; + if (power > SX126X_MAX_POWER) // This chip has lower power limits than some + power = SX126X_MAX_POWER; + err = lora.setOutputPower(power); assert(err == RADIOLIB_ERR_NONE); diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index 0044ae7e5..ab513cece 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -105,8 +105,9 @@ bool SX128xInterface::reconfigure() if (err != RADIOLIB_ERR_NONE) RECORD_CRITICALERROR(CriticalErrorCode_INVALID_RADIO_SETTING); - if (power > 22) // This chip has lower power limits than some - power = 22; + if (power > SX128X_MAX_POWER) // This chip has lower power limits than some + power = SX128X_MAX_POWER; + err = lora.setOutputPower(power); assert(err == RADIOLIB_ERR_NONE); @@ -218,7 +219,11 @@ bool SX128xInterface::isChannelActive() template bool SX128xInterface::isActivelyReceiving() { - return isChannelActive(); + // return isChannelActive(); + + uint16_t irq = lora.getIrqStatus(); + bool hasPreamble = (irq & RADIOLIB_SX128X_IRQ_HEADER_VALID); + return hasPreamble; } template diff --git a/variants/tlora_v2_1_18/platformio.ini b/variants/tlora_v2_1_18/platformio.ini index 4160be5de..f5af98904 100644 --- a/variants/tlora_v2_1_18/platformio.ini +++ b/variants/tlora_v2_1_18/platformio.ini @@ -5,4 +5,4 @@ lib_deps = ${esp32_base.lib_deps} caveman99/ESP32 Codec2@^1.0.1 build_flags = - ${esp32_base.build_flags} -D TLORA_V2_1_18 -I variants/tlora_v2_1_18 \ No newline at end of file + ${esp32_base.build_flags} -D TLORA_V2_1_18 -I variants/tlora_v2_1_18 -D RADIOLIB_GODMODE \ No newline at end of file