When I’m trying to use interrupt in my code for wifi_kit_8 (esp8266 .91oled board), I meet error codes output to serial like below:
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
ISR not in IRAM!
User exception (panic/abort/assert)
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Abort called
>>>stack>>>
ctx: cont
sp: 3ffffef0 end: 3fffffc0 offset: 0000
3ffffef0: feefeffe feefeffe feefeffe 00000100
3fffff00: 000000fe 00000000 00000000 00000000
3fffff10: 00000000 00000000 00000000 00ff0000
3fffff20: 5ffffe00 5ffffe00 3ffeefec 00000000
3fffff30: 00000003 0000000d 3ffee33c 40201d3e
3fffff40: 40100466 40202d25 ffffffff 40201d50
3fffff50: feefeffe 00000001 3ffee33c 40202266
3fffff60: 00000000 00000001 3ffee314 40201214
3fffff70: 00000000 feefeffe feefeffe 3ffee37c
3fffff80: 3fffdad0 00000000 3ffee33c 40202318
3fffff90: 3fffdad0 00000000 3ffee33c 4020106d
3fffffa0: feefeffe feefeffe feefeffe 4020194c
3fffffb0: feefeffe feefeffe 3ffe84e0 40100da5
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
My code for interrupt testing is below:
const int interruptPin = 0; //GPIO 0 (Flash Button) 0,15,13,12,14,2
const int LED = 15; //pin for driving LED
//get executed when interrupt occures
void handleInterrupt() {
Serial.println("Interrupt Detected");
}
void setup() {
Serial.begin(115200);
pinMode(LED,OUTPUT);
pinMode(interruptPin, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(interruptPin), handleInterrupt, CHANGE);
}
void loop()
{
digitalWrite(LED,LOW); //LED on
}