Skip to content

Commit

Permalink
Fix LoRa SX1262 user GPIO selection
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed Feb 26, 2024
1 parent 2e9e2da commit 8f1cb34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 7 additions & 6 deletions tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx126x.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifdef USE_SPI_LORA
#ifdef USE_LORA_SX126X
/*********************************************************************************************\
* Semtech SX1261/62 Long Range (LoRa)
* Latest Semtech SX1261/62 Long Range (LoRa)
* - LilyGo T3S3 LoRa32 868MHz ESP32S3 (uses SX1262)
* - LilyGo TTGO T-Weigh ESP32 LoRa 868MHz HX711 (uses SX1262)
* - Heltec (CubeCell) (uses SX1262)
Expand All @@ -27,9 +27,7 @@
\*********************************************************************************************/

#include <RadioLib.h>
SX1262 LoRaRadio = nullptr;

/*********************************************************************************************/
SX1262 LoRaRadio = nullptr; // Select LoRa support

void LoraOnReceiveSx126x(void) {
if (!Lora.enableInterrupt) { return; } // check if the interrupt is enabled
Expand Down Expand Up @@ -140,8 +138,11 @@ bool LoraConfigSx126x(void) {
}

bool LoraInitSx126x(void) {
// LoRa = new Module(Pin(GPIO_LORA_CS), Pin(GPIO_LORA_DI1), Pin(GPIO_LORA_RST), Pin(GPIO_LORA_BUSY));
LoRaRadio = new Module(Pin(GPIO_LORA_CS), 33, Pin(GPIO_LORA_RST), 34);
int lora_di1 = Pin(GPIO_LORA_DI1);
if (lora_di1 == -1) { lora_di1 = 33; } // Workaround support user config of GPIO33 on ESP32S3 for LilyGo T3S3
int lora_busy = Pin(GPIO_LORA_BUSY);
if (lora_busy == -1) { lora_busy = 34; } // Workaround support user config of GPIO34 on ESP32S3 for LilyGo T3S3
LoRaRadio = new Module(Pin(GPIO_LORA_CS), lora_di1, Pin(GPIO_LORA_RST), lora_busy);
if (RADIOLIB_ERR_NONE == LoRaRadio.begin(Lora.frequency)) {
LoraConfigSx126x();
LoRaRadio.setDio1Action(LoraOnReceiveSx126x);
Expand Down
6 changes: 2 additions & 4 deletions tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx127x.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifdef USE_SPI_LORA
#ifdef USE_LORA_SX127X
/*********************************************************************************************\
* Semtech SX1276/77/78/79 Long Range (LoRa)
* Legacy Semtech SX1276/77/78/79 Long Range (LoRa)
* - HopeRF RFM95W, RFM96W and RFM98W
* - LilyGo TTGO T3 LoRa32 868MHz ESP32 (uses SX1276)
* - LilyGo TTGO T-Higrow 868MHz (uses SX1276)
Expand All @@ -27,9 +27,7 @@
* - LoRa_DIO0
\*********************************************************************************************/

#include <LoRa.h>

/*********************************************************************************************/
#include <LoRa.h> // extern LoRaClass LoRa;

void LoraOnCadDoneSx127x(boolean signalDetected) {
if (signalDetected) { // detect preamble
Expand Down

0 comments on commit 8f1cb34

Please sign in to comment.