diff --git a/src/RCSwitch.cpp b/src/RCSwitch.cpp index efd1b54..952e492 100644 --- a/src/RCSwitch.cpp +++ b/src/RCSwitch.cpp @@ -42,12 +42,17 @@ #define memcpy_P(dest, src, num) memcpy((dest), (src), (num)) #endif -#if defined(ESP8266) || defined(ESP32) +#if defined(ESP8266) // interrupt handler and related code must be in RAM on ESP8266, // according to issue #46. #define RECEIVE_ATTR ICACHE_RAM_ATTR + #define VAR_ISR_ATTR +#elif defined(ESP32) + #define RECEIVE_ATTR IRAM_ATTR + #define VAR_ISR_ATTR DRAM_ATTR #else #define RECEIVE_ATTR + #define VAR_ISR_ATTR #endif @@ -81,7 +86,7 @@ * например 39 импульсов длительностью Te низкого уровня */ #if defined(ESP8266) || defined(ESP32) -static const RCSwitch::Protocol proto[] = { +static const VAR_ISR_ATTR RCSwitch::Protocol proto[] = { #else static const RCSwitch::Protocol PROGMEM proto[] = { #endif