From cab331df79f10912f272d1702a26fa9cc1fe8f6a Mon Sep 17 00:00:00 2001 From: David Gauchard Date: Wed, 17 Apr 2019 15:06:41 +0200 Subject: [PATCH] ISR: check for address in IRAM --- cores/esp8266/core_esp8266_wiring_digital.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cores/esp8266/core_esp8266_wiring_digital.cpp b/cores/esp8266/core_esp8266_wiring_digital.cpp index 28af409169..0a8a7252f1 100644 --- a/cores/esp8266/core_esp8266_wiring_digital.cpp +++ b/cores/esp8266/core_esp8266_wiring_digital.cpp @@ -171,6 +171,16 @@ void ICACHE_RAM_ATTR interrupt_handler(void *arg) { extern void cleanupFunctional(void* arg); extern void ICACHE_RAM_ATTR __attachInterruptArg(uint8_t pin, voidFuncPtr userFunc, void *arg, int mode) { + + // #5780 + // https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map + if ((uint32_t)userFunc >= 0x40200000) + { + // ISR not in IRAM + ::printf((PGM_P)F("ISR not in IRAM!\r\n")); + abort(); + } + if(pin < 16) { ETS_GPIO_INTR_DISABLE(); interrupt_handler_t *handler = &interrupt_handlers[pin];