@@ -27,8 +27,8 @@ interrupt service routines.
27
27
5 . [ ADC monitoring] ( ./DRIVERS.md#5-adc-monitoring ) Pause until an ADC goes out of bounds
28
28
5.1 [ AADC class] ( ./DRIVERS.md#51-aadc-class )
29
29
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 )
32
32
7.1 [ launch] ( ./DRIVERS.md#71-launch ) Run a coro or callback interchangeably
33
33
7.2 [ set_global_exception] ( ./DRIVERS.md#72-set_global_exception ) Simplify debugging with a global exception handler
34
34
@@ -44,6 +44,7 @@ Drivers are imported with:
44
44
from primitives.switch import Switch
45
45
from primitives.pushbutton import Pushbutton
46
46
from primitives.aadc import AADC
47
+ from primitives.irq_event import IRQ_EVENT
47
48
```
48
49
There is a test/demo program for the Switch and Pushbutton classes. On import
49
50
this lists available tests. It assumes a Pyboard with a switch or pushbutton
@@ -58,6 +59,12 @@ is run as follows:
58
59
from primitives.tests.adctest import test
59
60
test()
60
61
```
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
+ ```
61
68
62
69
###### [ Contents] ( ./DRIVERS.md#1-contents )
63
70
@@ -340,7 +347,10 @@ this for applications requiring rapid response.
340
347
Interfacing an interrupt service routine to ` uasyncio ` requires care. It is
341
348
invalid to issue ` create_task ` or to trigger an ` Event ` in an ISR as it can
342
349
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 ) .
344
354
345
355
Currently there are two ways of interfacing hard or soft IRQ's with ` uasyncio ` .
346
356
One is to use a busy-wait loop as per the
0 commit comments