]> git.tnoah.ca Git - lora-radio.git/commitdiff
Disable software SPI for ESP32 MCUs
authorjacob.eva <x00010@disroot.org>
Sat, 20 Jan 2024 11:26:48 +0000 (11:26 +0000)
committerjacob.eva <x00010@disroot.org>
Sat, 20 Jan 2024 11:26:48 +0000 (11:26 +0000)
Config.h
RNode_Firmware.ino

index 1e4ac8005cd311c1a1d7615b8a1e774b724e5093..85e4a413d26896c38ff5cc7c705a835f90dd6bc1 100644 (file)
--- a/Config.h
+++ b/Config.h
@@ -99,6 +99,8 @@
     #define HAS_PMU false
     #define HAS_NP false
     #define HAS_EEPROM false
+    const int pin_rxen = -1;
+    const int pin_busy = -1;
 
        #if MCU_VARIANT == MCU_1284P
                const int pin_cs = 4;
             #define EEPROM_OFFSET EEPROM_SIZE+0xED000-EEPROM_RESERVED
 
             // following pins are for the sx1262
-            const int pin_rxen = 37;
+            pin_rxen = 37;
             const int pin_reset = 38;
             const int pin_cs = 42;
             const int pin_sclk = 43;
             const int pin_mosi = 44;
             const int pin_miso = 45;
-            const int pin_busy = 46;
+            pin_busy = 46;
             const int pin_dio = 47;
             const int pin_led_rx = LED_BLUE;
             const int pin_led_tx = LED_GREEN;
        #define eeprom_addr(a) (a+EEPROM_OFFSET)
 
     #if MODEM == SX1276 || MODEM == SX1278
-        SPIClass spiModem(pin_miso, pin_sclk, pin_mosi);
+        SPIClass spiModem();
     #elif MODEM == SX1262
         SPIClass spiModem(NRF_SPIM2, pin_miso, pin_sclk, pin_mosi);
     #endif
index b59c5d130149dad99ea2a549054106e2b95947be..fc69a9021d426d61255661e02aec29957a88c710 100644 (file)
@@ -86,7 +86,11 @@ void setup() {
 
   // Set chip select, reset and interrupt
   // pins for the LoRa module
-  LoRa.setPins(pin_cs, pin_reset, pin_dio, pin_rxen, pin_busy);
+  if ((pin_rxen != -1) && (pin_busy != -1)) {
+      LoRa.setPins(pin_cs, pin_reset, pin_dio, pin_rxen, pin_busy);
+  } else {
+      LoRa.setPins(pin_cs, pin_reset, pin_dio);
+  }
   
   #if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
     init_channel_stats();