1
0
Fork 0

wasp: drivers: nrf_rtc: Fix a nasty bug when setting the time

The code to recalculate the uptime to walltime adjustment was broken
(e.g. the longer we leave it after reboot the more inaccurate the time
setting becomes).

Fixes: 80079e4 ("wasp: nrf_rtc: Add a tiny bit of extra resolution")
This commit is contained in:
Daniel Thompson 2020-04-26 14:59:29 +01:00
parent 94a6d4c78a
commit 2d437b0f68

View file

@ -51,7 +51,7 @@ class RTC(object):
t = (yyyy, mm, dd, HH, MM, SS, 0, 0)
lt = time.mktime(t)
self.offset = lt - self._uptime
self.offset = lt - (self._uptime >> 3)
def get_localtime(self):
self.update()