summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-29 16:07:37 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-29 16:07:37 (GMT)
commit62bca4d288e837b1df70b1a247cdb3c7431da9d9 (patch)
tree635c02030643db8a04628711cd227deb86ec4240
parentd69598132332736e22fbe8a98c2b9bd528bcd182 (diff)
simulator: Better align simulator RTC API with the nRF API
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
-rw-r--r--wasp/boards/simulator/watch.py7
1 files changed, 6 insertions, 1 deletions
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()