Skip to content

Commit

Permalink
Use DRAM for ESP32 protocol list
Browse files Browse the repository at this point in the history
And replace ICACHE_RAM_ATTR by IRAM_ATTR for ESP32, so as to avoir core dump when using in conjunction with Wifi
1technophile/OpenMQTTGateway#620
  • Loading branch information
1technophile committed Jun 21, 2020
1 parent bd0d2d5 commit db3235c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions RCSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,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


Expand All @@ -70,7 +75,7 @@
* These are combined to form Tri-State bits when sending or receiving codes.
*/
#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
Expand Down

0 comments on commit db3235c

Please sign in to comment.