mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-28 10:42:08 +00:00
Merge pull request #2157 from andrew-moroz/sx126x-rx-boosted-gain
sx126x-rx-boosted-gain: add support for setting Rx gain mode on SX126x chipsets
This commit is contained in:
commit
0b1e1687ae
@ -66,7 +66,7 @@ lib_deps =
|
|||||||
nanopb/Nanopb@^0.4.6
|
nanopb/Nanopb@^0.4.6
|
||||||
erriez/ErriezCRC32@^1.0.1
|
erriez/ErriezCRC32@^1.0.1
|
||||||
; jgromes/RadioLib@^5.5.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
|
; Used for the code analysis in PIO Home / Inspect
|
||||||
check_tool = cppcheck
|
check_tool = cppcheck
|
||||||
|
@ -160,6 +160,7 @@ void NodeDB::installDefaultConfig()
|
|||||||
config.has_power = true;
|
config.has_power = true;
|
||||||
config.has_network = true;
|
config.has_network = true;
|
||||||
config.has_bluetooth = true;
|
config.has_bluetooth = true;
|
||||||
|
config.lora.sx126x_rx_boosted_gain = false;
|
||||||
config.lora.tx_enabled =
|
config.lora.tx_enabled =
|
||||||
true; // FIXME: maybe false in the future, and setting region to enable it. (unset region forces it off)
|
true; // FIXME: maybe false in the future, and setting region to enable it. (unset region forces it off)
|
||||||
config.lora.override_duty_cycle = false;
|
config.lora.override_duty_cycle = false;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "SX126xInterface.h"
|
#include "SX126xInterface.h"
|
||||||
|
#include "mesh/NodeDB.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
@ -78,6 +79,14 @@ template <typename T> bool SX126xInterface<T>::init()
|
|||||||
res = lora.setDio2AsRfSwitch(true);
|
res = lora.setDio2AsRfSwitch(true);
|
||||||
#endif
|
#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
|
#if 0
|
||||||
// Read/write a register we are not using (only used for FSK mode) to test SPI comms
|
// Read/write a register we are not using (only used for FSK mode) to test SPI comms
|
||||||
uint8_t crcLSB = 0;
|
uint8_t crcLSB = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user