Skip to content

Commit ab12516

Browse files
d-a-vearlephilhower
authored andcommitted
ISR: check for address in IRAM (esp8266#5995)
1 parent 2c36cfe commit ab12516

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cores/esp8266/core_esp8266_wiring_digital.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,16 @@ void ICACHE_RAM_ATTR interrupt_handler(void *arg) {
171171
extern void cleanupFunctional(void* arg);
172172

173173
extern void ICACHE_RAM_ATTR __attachInterruptArg(uint8_t pin, voidFuncPtr userFunc, void *arg, int mode) {
174+
175+
// #5780
176+
// https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map
177+
if ((uint32_t)userFunc >= 0x40200000)
178+
{
179+
// ISR not in IRAM
180+
::printf((PGM_P)F("ISR not in IRAM!\r\n"));
181+
abort();
182+
}
183+
174184
if(pin < 16) {
175185
ETS_GPIO_INTR_DISABLE();
176186
interrupt_handler_t *handler = &interrupt_handlers[pin];

0 commit comments

Comments
 (0)