Skip to content
Snippets Groups Projects
Commit 71df60cf authored by Robert HH's avatar Robert HH Committed by Damien George
Browse files

esp8266/ets_alt_task.c: Prevent spurious large increment of ticks_ms()

This happened when the overflow counter for ticks_ms() was interrupted
by an external hard interrupt (issue #3076).
parent ec534609
No related branches found
No related tags found
No related merge requests found
...@@ -120,11 +120,13 @@ bool ets_loop_iter(void) { ...@@ -120,11 +120,13 @@ bool ets_loop_iter(void) {
} }
// handle overflow of system microsecond counter // handle overflow of system microsecond counter
ets_intr_lock();
uint32_t system_time_cur = system_get_time(); uint32_t system_time_cur = system_get_time();
if (system_time_cur < system_time_prev) { if (system_time_cur < system_time_prev) {
system_time_high_word += 1; // record overflow of low 32-bits system_time_high_word += 1; // record overflow of low 32-bits
} }
system_time_prev = system_time_cur; system_time_prev = system_time_cur;
ets_intr_unlock();
//static unsigned cnt; //static unsigned cnt;
bool progress = false; bool progress = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment