From 6ddfb2ff7de7f027eb7f570f1292f6f9df85bf66 Mon Sep 17 00:00:00 2001 From: Felix Rusu Date: Thu, 25 Jul 2019 10:41:14 -0400 Subject: [PATCH] Add ISR_PREFIX for ESP See Issue #124 --- RFM69.cpp | 2 +- RFM69.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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