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).
pull/3062/head^2
Robert HH 2017-05-12 20:37:49 +02:00 zatwierdzone przez Damien George
rodzic ec534609f6
commit 71df60cf42
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -120,11 +120,13 @@ bool ets_loop_iter(void) {
}
// handle overflow of system microsecond counter
ets_intr_lock();
uint32_t system_time_cur = system_get_time();
if (system_time_cur < system_time_prev) {
system_time_high_word += 1; // record overflow of low 32-bits
}
system_time_prev = system_time_cur;
ets_intr_unlock();
//static unsigned cnt;
bool progress = false;