Skip to content

Commit

Permalink
ISR: check for address in IRAM (#5995)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-a-v authored and earlephilhower committed Apr 19, 2019
1 parent 2c36cfe commit ab12516
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cores/esp8266/core_esp8266_wiring_digital.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit ab12516

Please sign in to comment.