mongoose-os-libs / arduino-compat

Arduino compatibility library for Mongoose OS
https://mongoose-os.com
Other
11 stars 8 forks source link

Fixed millis() overflow on SNTP reply #1

Closed cullenfj closed 7 years ago

cullenfj commented 7 years ago

mg_time() gets updated to a very large number after an SNTP reply, which results in an overflow when converting from double to long. Using mgos_uptime() instead should fix this.

rojer commented 7 years ago

not only that, but according to docs millis and micros are supposed to return uptime, not wall time. i'll integrate this fix into our repo thanks @cullenfj !