Skip to content

Commit

Permalink
ESP8266: Fix overflow check condition
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Jul 26, 2021
1 parent fcc40e5 commit a0be0b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platforms/esp8266/src/esp_libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ IRAM int64_t mgos_uptime_micros(void) {
* We don't want to disable ints for every call to this function,
* hence the trickery.
*/
if (((time ^ prev_time) & (1UL << 31)) != 0) {
if (((time ^ prev_time) & (1UL << 31)) != 0 && (time & (1UL << 31)) == 0) {
mgos_ints_disable();
if (t[1] == num_overflows) {
/* We got here first, update the global overflow counter. */
Expand Down

0 comments on commit a0be0b3

Please sign in to comment.