From 62bca4d288e837b1df70b1a247cdb3c7431da9d9 Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Tue, 29 Dec 2020 16:07:37 +0000 Subject: [PATCH] simulator: Better align simulator RTC API with the nRF API Signed-off-by: Daniel Thompson --- wasp/boards/simulator/watch.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wasp/boards/simulator/watch.py b/wasp/boards/simulator/watch.py index 000184a..e5cf2b2 100644 --- a/wasp/boards/simulator/watch.py +++ b/wasp/boards/simulator/watch.py @@ -15,6 +15,7 @@ sys.print_exception = print_exception import array import draw565 import os +import warnings from machine import I2C from machine import Pin @@ -108,11 +109,15 @@ class RTC(object): self._lasttime = now return True + def set_localtime(self, t): + """Set the current wall time.""" + warnings.warn('set_localtime() is not supported on simulator') + def get_localtime(self): #if self.uptime < 60: # # Jump back a little over a day # return time.localtime(time.time() - 100000) - return time.localtime() + return time.localtime()[:8] def get_time(self): now = self.get_localtime()