Only call SPI.usingInterrupt if SPI_HAS_NOTUSINGINTERRUPT is defined

master
Sandeep Mistry 2018-02-15 21:14:03 -05:00
parent 3ec90c02b4
commit f5cae9c25d
1 changed files with 2 additions and 1 deletions

View File

@ -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));