Open jordansissel opened 7 years ago
Context on how I encountered this:
Adafruit's Neopixel library has a 'send' method that waits/blocks if the previous send was too-recently. This wait relies on micros()
for duration computation. Because micros()
becomes stuck at max_unsigned_int after sntp runs, the micros()
clock never moves, and the next Neopixel send()
will get stuck and trigger the watchdog.
I am working around this by commenting out the while (!canSend())
call which skips the busy wait
Code:
Console before/after sntp:
After SNTP, micros() starts returning 4294967295 (2^32 - 1) for all calls.
micros() is based on mg_time() which returns a double and reports wall clock (it is not monotonic).
The Arduino docs say this about
micros()
:Should mongoose's Arduino compat, then, use the boot-time (monotonic?) clock instead of the wall clock (sync'd with sntp)?