mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-21 20:44:47 +00:00
Skip setting dio2 as rf switch altogether if txen is defined
This commit is contained in:
parent
4029f731c9
commit
75504793e8
@ -60,19 +60,20 @@ template <typename T> bool SX126xInterface<T>::init()
|
|||||||
LOG_DEBUG("Current limit set to %f\n", currentLimit);
|
LOG_DEBUG("Current limit set to %f\n", currentLimit);
|
||||||
LOG_DEBUG("Current limit set result %d\n", res);
|
LOG_DEBUG("Current limit set result %d\n", res);
|
||||||
|
|
||||||
#ifdef SX126X_E22
|
|
||||||
// E22 Emulation explicitly requires DIO2 as RF switch, so set it to TRUE again for good measure. In case somebody defines
|
|
||||||
// SX126X_TX for an E22 Module
|
|
||||||
if (res == RADIOLIB_ERR_NONE)
|
|
||||||
res = lora.setDio2AsRfSwitch(true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SX126X_TXEN) && (SX126X_TXEN != RADIOLIB_NC)
|
#if defined(SX126X_TXEN) && (SX126X_TXEN != RADIOLIB_NC)
|
||||||
// lora.begin sets Dio2 as RF switch control, which is not true if we are manually controlling RX and TX
|
// lora.begin sets Dio2 as RF switch control, which is not true if we are manually controlling RX and TX
|
||||||
if (res == RADIOLIB_ERR_NONE) {
|
if (res == RADIOLIB_ERR_NONE) {
|
||||||
|
LOG_DEBUG("SX126X_TX/RX EN pins defined. Setting RF Switch: RXEN=%i, TXEN=%i\n", SX126X_RXEN, SX126X_TXEN);
|
||||||
res = lora.setDio2AsRfSwitch(false);
|
res = lora.setDio2AsRfSwitch(false);
|
||||||
lora.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
|
lora.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
|
||||||
}
|
}
|
||||||
|
#elif defined(SX126X_E22)
|
||||||
|
// E22 Emulation explicitly requires DIO2 as RF switch, so set it to TRUE again for good measure. In case somebody defines
|
||||||
|
// SX126X_TX for an E22 Module
|
||||||
|
if (res == RADIOLIB_ERR_NONE) {
|
||||||
|
LOG_DEBUG("SX126X_E22 mode enabled. Setting DIO2 as RF Switch\n");
|
||||||
|
res = lora.setDio2AsRfSwitch(true);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (config.lora.sx126x_rx_boosted_gain) {
|
if (config.lora.sx126x_rx_boosted_gain) {
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
#define SX126X_DIO1 LORA_DIO1
|
#define SX126X_DIO1 LORA_DIO1
|
||||||
#define SX126X_BUSY LORA_DIO2
|
#define SX126X_BUSY LORA_DIO2
|
||||||
#define SX126X_RESET LORA_RESET
|
#define SX126X_RESET LORA_RESET
|
||||||
//#define SX126X_RXEN 14
|
#define SX126X_RXEN 14
|
||||||
//#define SX126X_TXEN 13
|
#define SX126X_TXEN 13
|
||||||
#define SX126X_POWER_EN (13)
|
//#define SX126X_POWER_EN (13)
|
||||||
|
|
||||||
// RX/TX for RFM95/SX127x
|
// RX/TX for RFM95/SX127x
|
||||||
#define RF95_RXEN 14
|
#define RF95_RXEN 14
|
||||||
|
Loading…
Reference in New Issue
Block a user