diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2023-06-08 16:08:09 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-06-19 18:36:54 +1000 |
commit | 9092909bf5e5f3347a93ea5146dd93320527956a (patch) | |
tree | 4ecab114ec4a3bb3a3a9b1f2bfe24bdea6c33473 /docs/reference | |
parent | 6027c41c8f5b8f1a9e7b85b2bb93b3e6f2718e54 (diff) | |
download | micropython-9092909bf5e5f3347a93ea5146dd93320527956a.tar.gz micropython-9092909bf5e5f3347a93ea5146dd93320527956a.zip |
docs: Rename uasyncio to asyncio.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'docs/reference')
-rw-r--r-- | docs/reference/isr_rules.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/reference/isr_rules.rst b/docs/reference/isr_rules.rst index bdb838c590..ea330acad3 100644 --- a/docs/reference/isr_rules.rst +++ b/docs/reference/isr_rules.rst @@ -219,20 +219,20 @@ Exceptions If an ISR raises an exception it will not propagate to the main loop. The interrupt will be disabled unless the exception is handled by the ISR code. -Interfacing to uasyncio ------------------------ +Interfacing to asyncio +---------------------- -When an ISR runs it can preempt the `uasyncio` scheduler. If the ISR performs a `uasyncio` +When an ISR runs it can preempt the `asyncio` scheduler. If the ISR performs a `asyncio` operation the scheduler's operation can be disrupted. This applies whether the interrupt is hard or soft and also applies if the ISR has passed execution to another function via `micropython.schedule`. In particular creating or cancelling tasks is invalid in an ISR context. -The safe way to interact with `uasyncio` is to implement a coroutine with synchronisation performed by -`uasyncio.ThreadSafeFlag`. The following fragment illustrates the creation of a task in response +The safe way to interact with `asyncio` is to implement a coroutine with synchronisation performed by +`asyncio.ThreadSafeFlag`. The following fragment illustrates the creation of a task in response to an interrupt: .. code:: python - tsf = uasyncio.ThreadSafeFlag() + tsf = asyncio.ThreadSafeFlag() def isr(_): # Interrupt handler tsf.set() @@ -240,7 +240,7 @@ to an interrupt: async def foo(): while True: await tsf.wait() - uasyncio.create_task(bar()) + asyncio.create_task(bar()) In this example there will be a variable amount of latency between the execution of the ISR and the execution of ``foo()``. This is inherent to cooperative scheduling. The maximum latency is application |