From f5cae9c25db74f9b13c47456fb5a1fd31c34fc4e Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Thu, 15 Feb 2018 21:14:03 -0500 Subject: [PATCH] Only call SPI.usingInterrupt if SPI_HAS_NOTUSINGINTERRUPT is defined --- src/LoRa.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/LoRa.cpp b/src/LoRa.cpp index 3d62073..96e50dc 100644 --- a/src/LoRa.cpp +++ b/src/LoRa.cpp @@ -282,8 +282,9 @@ void LoRaClass::onReceive(void(*callback)(int)) pinMode(_dio0, INPUT); writeRegister(REG_DIO_MAPPING_1, 0x00); - +#ifdef SPI_HAS_NOTUSINGINTERRUPT SPI.usingInterrupt(digitalPinToInterrupt(_dio0)); +#endif attachInterrupt(digitalPinToInterrupt(_dio0), LoRaClass::onDio0Rise, RISING); } else { detachInterrupt(digitalPinToInterrupt(_dio0));