From 37fd8885277c8fe1ab41cbac97c9a3ed3078afe2 Mon Sep 17 00:00:00 2001 From: matthias-bs <83612361+matthias-bs@users.noreply.github.com> Date: Sun, 20 Jun 2021 23:03:08 +0200 Subject: [PATCH] Fixed interrupt handling on ESP8266 With ESP8266 Arduino noard support package V3.0.0 an exception is issued whenever an interrupt occurs: [...] connected...yeey :) HTTP server started local ip: 192.168.156.166 *WM: freeing allocated params! pm open,type:2 0 handleReceive() ISR not in IRAM! User exception (panic/abort/assert) --------------- CUT HERE FOR EXCEPTION DECODER --------------- Abort called >>>stack>>> [...] --- RFControl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFControl.cpp b/RFControl.cpp index 0e3f1ea..4c60768 100644 --- a/RFControl.cpp +++ b/RFControl.cpp @@ -288,7 +288,11 @@ void verification(int package) { } } +#if defined(ESP8266) +void ICACHE_RAM_ATTR handleInterrupt() { +#else void handleInterrupt() { +#endif //hw_digitalWrite(9, HIGH); unsigned long currentTime = hw_micros(); duration = (currentTime - lastTime) / PULSE_LENGTH_DIVIDER;