1
0
Fork 0

wasp: Allow for clearing a tick request

There currently appears to be no way to remove a tick request,
and calling this func without args gives:

    self.tick_expiry = watch.rtc.get_uptime_ms() + period_ms
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

Signed-off-by: Kyle Evans <kvans32@gmail.com>
This commit is contained in:
Kyle Evans 2023-06-21 19:06:30 -04:00 committed by Daniel Thompson
parent 410b9da55f
commit 9486899f4e

View file

@ -374,8 +374,12 @@ class Manager():
Note: With the current simplistic timer implementation sub-second Note: With the current simplistic timer implementation sub-second
tick intervals are not possible. tick intervals are not possible.
""" """
if period_ms:
self.tick_period_ms = period_ms self.tick_period_ms = period_ms
self.tick_expiry = watch.rtc.get_uptime_ms() + period_ms self.tick_expiry = watch.rtc.get_uptime_ms() + period_ms
else:
self.tick_period_ms = 0
self.tick_expiry = None
def keep_awake(self): def keep_awake(self):
"""Reset the keep awake timer.""" """Reset the keep awake timer."""