diff --git a/RFM69.cpp b/RFM69.cpp index d2aef58..f9998da 100644 --- a/RFM69.cpp +++ b/RFM69.cpp @@ -371,7 +371,7 @@ void RFM69::interruptHandler() { } // internal function -void RFM69::isr0() { _haveData = true; } +ISR_PREFIX void RFM69::isr0() { _haveData = true; } // internal function void RFM69::receiveBegin() { diff --git a/RFM69.h b/RFM69.h index e82dd6a..8289deb 100644 --- a/RFM69.h +++ b/RFM69.h @@ -68,6 +68,12 @@ #endif #endif +#if defined(ESP8266) || defined(ESP32) + #define ISR_PREFIX ICACHE_RAM_ATTR +#else + #define ISR_PREFIX +#endif + // digitalPinToInterrupt is not available prior to Arduino 1.5.6 and 1.0.6 // See http://arduino.cc/en/Reference/attachInterrupt #ifndef NOT_AN_INTERRUPT