nerves-time / nerves_time

Keep time in sync on Nerves devices
Other
23 stars 13 forks source link

Battery Backed RTC Implementation #123

Open mmccall10 opened 1 year ago

mmccall10 commented 1 year ago

Waiting for NervesTime.Ntpd to synchronize can cause unnecessary delay with a battery backed clock. If it is known that the device has a battery backed rtc allow that to be configured. This PR also adds a synchronized check to the system time. When using BatterBackedTime the rtc will be in sync on start, permitting NervesTime.synchronized?/0 to evaluate true even if NTP has not been synchronized.

config :nerves_time, rtc: NervesTime.BatteryBackedTime