diff options
author | Robert HH <robert@hammelrath.com> | 2017-05-12 20:37:49 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-05-13 17:56:16 +1000 |
commit | 71df60cf42d831b4d6e39dc7bee3c45f46befdab (patch) | |
tree | ea1e1849cd112a2dc4b798d75cd2e7b55569efd3 | |
parent | ec534609f665cb791b8fc1eae1a44e514c297659 (diff) | |
download | micropython-71df60cf42d831b4d6e39dc7bee3c45f46befdab.tar.gz micropython-71df60cf42d831b4d6e39dc7bee3c45f46befdab.zip |
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).
-rw-r--r-- | esp8266/ets_alt_task.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/esp8266/ets_alt_task.c b/esp8266/ets_alt_task.c index 6434f23660..ff7dba1869 100644 --- a/esp8266/ets_alt_task.c +++ b/esp8266/ets_alt_task.c @@ -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; |