mikaelpatel/Cosa — pull request #250 by jediunix (2014-11-04 13:51:49+00:00)
Title: Improve accuracy of RTC

The RTC clock runs fast. At 16mhz each second is 576us fast or 9 ticks
every 16 seconds which is approximately 2 seconds per hour. This
change accumulates the error every second and then suppresses a tick
when enough error has been accumulated. At 16mhz this is approximately
every other second (9 every 16).

The problem and solution was verified with GPS time. In 17 hours the
RTC is now 4 seconds slow. This is probably due to the accuracy of my
oscillator and will require future modifications to allow disciplining
the clock from an external source.