From e5f8167ebe70d658d220e78168f6069ac740e84f Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 22 May 2019 13:51:33 +0200 Subject: [PATCH] Trying to fix exception 0 (#5837) Trying to fix exception 0 on counter usage (#5837) --- sonoff/support_rotary.ino | 2 +- sonoff/xsns_01_counter.ino | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sonoff/support_rotary.ino b/sonoff/support_rotary.ino index 35974251b..64a7bc738 100644 --- a/sonoff/support_rotary.ino +++ b/sonoff/support_rotary.ino @@ -62,7 +62,7 @@ void update_position(void) } #ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception -void update_rotary(void) ICACHE_RAM_ATTR; // As iram is tight and it works this way too +void update_rotary(void) ICACHE_RAM_ATTR; #endif // ARDUINO_ESP8266_RELEASE_2_3_0 void update_rotary(void) diff --git a/sonoff/xsns_01_counter.ino b/sonoff/xsns_01_counter.ino index 069016a87..84b1c29ea 100644 --- a/sonoff/xsns_01_counter.ino +++ b/sonoff/xsns_01_counter.ino @@ -25,6 +25,14 @@ unsigned long last_counter_timer[MAX_COUNTERS]; // Last counter time in micro seconds +#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception +void CounterUpdate(uint8_t index) ICACHE_RAM_ATTR; +void CounterUpdate1(void) ICACHE_RAM_ATTR; +void CounterUpdate2(void) ICACHE_RAM_ATTR; +void CounterUpdate3(void) ICACHE_RAM_ATTR; +void CounterUpdate4(void) ICACHE_RAM_ATTR; +#endif // ARDUINO_ESP8266_RELEASE_2_3_0 + void CounterUpdate(uint8_t index) { unsigned long counter_debounce_time = micros() - last_counter_timer[index -1]; @@ -40,13 +48,6 @@ void CounterUpdate(uint8_t index) } } -#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception -void CounterUpdate1(void) ICACHE_RAM_ATTR; // As iram is tight and it works this way too -void CounterUpdate2(void) ICACHE_RAM_ATTR; // As iram is tight and it works this way too -void CounterUpdate3(void) ICACHE_RAM_ATTR; // As iram is tight and it works this way too -void CounterUpdate4(void) ICACHE_RAM_ATTR; // As iram is tight and it works this way too -#endif // ARDUINO_ESP8266_RELEASE_2_3_0 - void CounterUpdate1(void) { CounterUpdate(1);