diff --git a/platformio.ini b/platformio.ini index edcc8618c..2652e81dd 100644 --- a/platformio.ini +++ b/platformio.ini @@ -66,7 +66,7 @@ lib_deps = nanopb/Nanopb@^0.4.6 erriez/ErriezCRC32@^1.0.1 ; jgromes/RadioLib@^5.5.1 - https://github.com/jgromes/RadioLib.git#395844922c5d88d5db0481a9c91479931172428d + https://github.com/jgromes/RadioLib.git#7a25b27c3183ffe3627c5c221243c378d8951da7 ; Used for the code analysis in PIO Home / Inspect check_tool = cppcheck diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index fc48fddea..cfb815d1e 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -160,6 +160,7 @@ void NodeDB::installDefaultConfig() config.has_power = true; config.has_network = true; config.has_bluetooth = true; + config.lora.sx126x_rx_boosted_gain = false; config.lora.tx_enabled = true; // FIXME: maybe false in the future, and setting region to enable it. (unset region forces it off) config.lora.override_duty_cycle = false; diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index dfe2433e8..68bd6326a 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -1,4 +1,5 @@ #include "SX126xInterface.h" +#include "mesh/NodeDB.h" #include "configuration.h" #include "error.h" @@ -78,6 +79,14 @@ template bool SX126xInterface::init() res = lora.setDio2AsRfSwitch(true); #endif +if (config.lora.sx126x_rx_boosted_gain) { + uint16_t result = lora.setRxBoostedGainMode(true); + LOG_INFO("Set Rx Boosted Gain mode; result: %d\n", result); +} else { + uint16_t result = lora.setRxBoostedGainMode(false); + LOG_INFO("Set Rx Power Saving Gain mode; result: %d\n", result); +} + #if 0 // Read/write a register we are not using (only used for FSK mode) to test SPI comms uint8_t crcLSB = 0;