Skip to content

Commit 931dc75

Browse files
committed
v3/docs/DRIVERS.md Imporove IRQ_EVENT documentation.
1 parent 84ae852 commit 931dc75

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

v3/docs/DRIVERS.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ interrupt service routines.
2727
5. [ADC monitoring](./DRIVERS.md#5-adc-monitoring) Pause until an ADC goes out of bounds
2828
5.1 [AADC class](./DRIVERS.md#51-aadc-class)
2929
5.2 [Design note](./DRIVERS.md#52-design-note)
30-
6. [IRQ_EVENT](./DRIVERS.md#6-irq_event)
31-
7. [Additional functions](./DRIVERS.md#6-additional-functions)
30+
6. [IRQ_EVENT](./DRIVERS.md#6-irq_event) Interfacing to interrupt service routines.
31+
7. [Additional functions](./DRIVERS.md#7-additional-functions)
3232
7.1 [launch](./DRIVERS.md#71-launch) Run a coro or callback interchangeably
3333
7.2 [set_global_exception](./DRIVERS.md#72-set_global_exception) Simplify debugging with a global exception handler
3434

@@ -44,6 +44,7 @@ Drivers are imported with:
4444
from primitives.switch import Switch
4545
from primitives.pushbutton import Pushbutton
4646
from primitives.aadc import AADC
47+
from primitives.irq_event import IRQ_EVENT
4748
```
4849
There is a test/demo program for the Switch and Pushbutton classes. On import
4950
this lists available tests. It assumes a Pyboard with a switch or pushbutton
@@ -58,6 +59,12 @@ is run as follows:
5859
from primitives.tests.adctest import test
5960
test()
6061
```
62+
The test for the `IRQ_EVENT` class requires a Pyboard with pins X1 and X2
63+
linked. It is run as follows:
64+
```python
65+
from primitives.tests.irq_event_test import test
66+
test()
67+
```
6168

6269
###### [Contents](./DRIVERS.md#1-contents)
6370

@@ -340,7 +347,10 @@ this for applications requiring rapid response.
340347
Interfacing an interrupt service routine to `uasyncio` requires care. It is
341348
invalid to issue `create_task` or to trigger an `Event` in an ISR as it can
342349
cause a race condition in the scheduler. It is intended that `Event` will
343-
become compatible with soft IRQ's in a future revison of `uasyncio`.
350+
become compatible with soft IRQ's in a future revison of `uasyncio`. See
351+
[iss 6415](https://github.com/micropython/micropython/issues/6415),
352+
[PR 6106](https://github.com/micropython/micropython/pull/6106) and
353+
[iss 5795](https://github.com/micropython/micropython/issues/5795).
344354

345355
Currently there are two ways of interfacing hard or soft IRQ's with `uasyncio`.
346356
One is to use a busy-wait loop as per the

0 commit comments

Comments
 (0)