Skip to content

Commit

Permalink
fix RadioLibHAL
Browse files Browse the repository at this point in the history
  • Loading branch information
caveman99 committed May 10, 2023
1 parent fef590b commit 6a41dcc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,11 @@ void setup()
pinMode(RF95_NSS, OUTPUT);
digitalWrite(RF95_NSS, HIGH);
SPI1.begin(false);
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI1, spiSettings);
#else // HW_SPI1_DEVICE
SPI.setSCK(RF95_SCK);
SPI.setTX(RF95_MOSI);
SPI.setRX(RF95_MISO);
SPI.begin(false);
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
#endif // HW_SPI1_DEVICE
#elif !defined(ARCH_ESP32) // ARCH_RP2040
SPI.begin();
Expand Down Expand Up @@ -524,6 +522,12 @@ void setup()
digitalWrite(SX126X_ANT_SW, 1);
#endif

#ifdef HW_SPI1_DEVICE
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI1, spiSettings);
#else // HW_SPI1_DEVICE
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
#endif

// radio init MUST BE AFTER service.init, so we have our radio config settings (from nodedb init)

#if !HAS_RADIO && defined(ARCH_PORTDUINO)
Expand Down

0 comments on commit 6a41dcc

Please sign in to comment.