summaryrefslogtreecommitdiff
path: root/wasp/drivers
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-11-14 12:24:28 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-11-14 12:24:28 (GMT)
commitd0a99d5636e9e597a44d872b5350c3588b032439 (patch)
tree8b0c975c43ef421fd78efd3aae09d69219ba2802 /wasp/drivers
parentd2357f232577d389a8b79afddd96cdf9f21695af (diff)
manager: Implement alarm callbacks for applications to use
Create a simple time queue where actions (functions or bound methods) can be queued against the real time clock. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/drivers')
-rw-r--r--wasp/drivers/nrf_rtc.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/wasp/drivers/nrf_rtc.py b/wasp/drivers/nrf_rtc.py
index 222be32..100bacd 100644
--- a/wasp/drivers/nrf_rtc.py
+++ b/wasp/drivers/nrf_rtc.py
@@ -103,6 +103,10 @@ class RTC(object):
localtime = self.get_localtime()
return localtime[3:6]
+ def time(self):
+ """Get time in the same format as time.time"""
+ return self.offset + (self._uptime >> 3)
+
@property
def uptime(self):
"""Provide the current uptime in seconds."""