phord / master_clock

Master clock protocol driver for IBM slave clocks from Arduino, Raspberry Pi, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clock should not advance when reset

phord opened this issue · comments

Currently the code advances the minute hand when the clock is first reset because we think the time is "00:00", so time to advance. This causes the clock to get bumped ahead a minute for each time you plug in power. So if the clock is powered off and on several times, it will advance an extra minute for each of those times.

When the NTP time is retrieved and we find out the real time, we're liable to advance again real soon, causing us to get even faster.

Maybe this will be moot once we have power-failure detection because we'll have to do the same kind of thing to figure out how many steps we "missed" while we were powered off. But I need to think that through, some.