diff --git a/tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx126x.ino b/tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx126x.ino index a6e5c7cb2..223586eb3 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx126x.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx126x.ino @@ -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) @@ -27,9 +27,7 @@ \*********************************************************************************************/ #include -SX1262 LoRaRadio = nullptr; - -/*********************************************************************************************/ +SX1262 LoRaRadio = nullptr; // Select LoRa support void LoraOnReceiveSx126x(void) { if (!Lora.enableInterrupt) { return; } // check if the interrupt is enabled @@ -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); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx127x.ino b/tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx127x.ino index bbc8657a6..e7f8c1c60 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx127x.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_73_3_lora_sx127x.ino @@ -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) @@ -27,9 +27,7 @@ * - LoRa_DIO0 \*********************************************************************************************/ -#include - -/*********************************************************************************************/ +#include // extern LoRaClass LoRa; void LoraOnCadDoneSx127x(boolean signalDetected) { if (signalDetected) { // detect preamble