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:
parent
94a6d4c78a
commit
2d437b0f68
1 changed files with 1 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue