fix custom SPI

This commit is contained in:
Timm Bogner 2023-03-18 10:48:38 -05:00
parent fb44bdd5fb
commit d8b61a44e1
2 changed files with 8 additions and 9 deletions

View File

@ -75,10 +75,10 @@
const uint8_t lora_size = 256 / sizeof(DataReading);
#ifdef CUSTOM_SPI
#ifdef ESP32
SPIClass SPI1(HSPI);
#endif // ESP32
#ifdef ARDUINO_ARCH_RP2040
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO, LORA_RST, LORA_BUSY, SPI1);
#endif // RP2040
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO, LORA_RST, LORA_BUSY, SPI);
#else
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO, LORA_RST, LORA_BUSY);
#endif // CUSTOM_SPI
@ -262,7 +262,7 @@ void begin_lora()
{
#ifdef CUSTOM_SPI
#ifdef ESP32
SPI1.begin(LORA_SPI_SCK, LORA_SPI_MISO, LORA_SPI_MOSI);
SPI.begin(LORA_SPI_SCK, LORA_SPI_MISO, LORA_SPI_MOSI);
#endif // ESP32
#ifdef ARDUINO_ARCH_RP2040
SPI1.setRX(LORA_SPI_MISO);

View File

@ -70,15 +70,14 @@
#endif // LORA_SYNCWORD
#ifdef CUSTOM_SPI
#ifdef ESP32
SPIClass SPI1(HSPI);
#endif // ESP32
#ifdef ARDUINO_ARCH_RP2040
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO, LORA_RST, LORA_BUSY, SPI1);
#endif // RP2040
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO, LORA_RST, LORA_BUSY, SPI);
#else
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO, LORA_RST, LORA_BUSY);
#endif // CUSTOM_SPI
bool pingFlag = false;
bool transmitFlag = false; // flag to indicate transmission or reception state
volatile bool enableInterrupt = true; // disable interrupt when it's not needed
@ -142,7 +141,7 @@ void begin_lora()
{
#ifdef CUSTOM_SPI
#ifdef ESP32
SPI1.begin(LORA_SPI_SCK, LORA_SPI_MISO, LORA_SPI_MOSI);
SPI.begin(LORA_SPI_SCK, LORA_SPI_MISO, LORA_SPI_MOSI);
#endif // ESP32
#ifdef ARDUINO_ARCH_RP2040
SPI1.setRX(LORA_SPI_MISO);