summaryrefslogtreecommitdiffstatshomepage
path: root/py/modmath.c
diff options
context:
space:
mode:
authorPhil Howard <phil@gadgetoid.com>2024-07-08 15:34:18 +0100
committerDamien George <damien@micropython.org>2024-08-02 16:27:42 +1000
commitad3552ae2cb5be65a8d61dc1c3bb2014d7ef4cae (patch)
treebb649a15f1bfb6ffd996744d11bf684dd88acb11 /py/modmath.c
parente7ff0b8a31a7f36cc1b3dfb7e5fd7b8805ff85ce (diff)
downloadmicropython-ad3552ae2cb5be65a8d61dc1c3bb2014d7ef4cae.tar.gz
micropython-ad3552ae2cb5be65a8d61dc1c3bb2014d7ef4cae.zip
rp2/rp2_pio: Make PIO IRQ handlers have lazy initialisation.
This change has no impact on vanilla MicroPython builds, but is intended to avoid RP2's PIO implementation from trampling PIO usage in USER_C_MODULES. This is consistent with PIOs tracking of used state machines and managed programs, and makes working with PIO in USER_C_MODULES much less of an uphill battle. Since PIO deinit runs before gc_sweep_all it's impossible to work around this wrinkle otherwise. A module finalizer does not get the opportunity to put the PIOs back into a state which wont crash rp2_pio_deinit. Changes are: - init: Avoid exclusive handlers being added to all PIOs and add them only when needed. - deinit: Only remove handlers we have set. - rp2_pio_irq: Add the exlusive handler if needed. - rp2_state_machine_irq: Add the exclusive handler if needed. Signed-off-by: Phil Howard <phil@gadgetoid.com>
Diffstat (limited to 'py/modmath.c')
0 files changed, 0 insertions, 0 deletions