summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/uasyncio/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/uasyncio/core.py')
-rw-r--r--extmod/uasyncio/core.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/uasyncio/core.py b/extmod/uasyncio/core.py
index 689487d36a..045b4cd139 100644
--- a/extmod/uasyncio/core.py
+++ b/extmod/uasyncio/core.py
@@ -53,7 +53,7 @@ class SingletonGenerator:
# Use a SingletonGenerator to do it without allocating on the heap
def sleep_ms(t, sgen=SingletonGenerator()):
assert sgen.state is None
- sgen.state = ticks_add(ticks(), t)
+ sgen.state = ticks_add(ticks(), max(0, t))
return sgen