Ahh - well, when you create a Clock object, it remembers the time you supplied and the value of getTime() at the time you created it. Then, when you ask for the current time, it does:
So in 1v71, even if you reset the board the Clock should still supply the right time.
The board has an internal real-time clock that will always store the correct time, and in pre-1v71 releases it was always reset on startup. In 1v71 I'm just detecting if the clock is already running, and if it is I leave it alone :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ahh - well, when you create a
Clock
object, it remembers the time you supplied and the value ofgetTime()
at the time you created it. Then, when you ask for the current time, it does:theDateYouGave + getTime() - getTimeWhenDateSupplied
So in 1v71, even if you reset the board the
Clock
should still supply the right time.The board has an internal real-time clock that will always store the correct time, and in pre-1v71 releases it was always reset on startup. In 1v71 I'm just detecting if the clock is already running, and if it is I leave it alone :)