summaryrefslogtreecommitdiff
path: root/extmod/uasyncio
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/uasyncio')
-rw-r--r--extmod/uasyncio/event.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/extmod/uasyncio/event.py b/extmod/uasyncio/event.py
index c48904b98..654ccefa9 100644
--- a/extmod/uasyncio/event.py
+++ b/extmod/uasyncio/event.py
@@ -36,7 +36,7 @@ class Event:
# MicroPython-extension: This can be set from outside the asyncio event loop,
# such as other threads, IRQs or scheduler context. Implementation is a stream
# that asyncio will poll until a flag is set.
-# Note: Unlike Event, this is self-clearing.
+# Note: Unlike Event, this is self-clearing after a wait().
try:
import uio
@@ -52,6 +52,9 @@ try:
def set(self):
self._flag = 1
+ def clear(self):
+ self._flag = 0
+
async def wait(self):
if not self._flag:
yield core._io_queue.queue_read(self)