Trying to fix exception 0 (#5837)

Trying to fix exception 0 on counter usage (#5837)
This commit is contained in:
Theo Arends 2019-05-22 13:51:33 +02:00
parent dc1bf2ff03
commit e5f8167ebe
2 changed files with 9 additions and 8 deletions

View File

@ -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)

View File

@ -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);