micropython/ports/rp2/modules
Chris Webb c3ca843493 rp2/modules/rp2.py: Don't corrupt globals on asm_pio() exception.
The rp2.asm_pio() decorator saves and temporarily replaces the globals
dictionary to allow the wrapped functions to reference PIO instructions
and register names in a natural way, restoring them before returning the
assembled program.

However, if an exception occurs while assembling the program, the globals
are not changed back, leaving them corrupted.

Wrap with try/finally to ensure they are always restored correctly.

Signed-off-by: Chris Webb <chris@arachsys.com>
2026-03-05 00:07:14 +11:00
..
_boot_fat.py rp2/modules: Fix FatFS boot script to detect invalid FAT filesystem. 2024-09-19 13:04:48 +10:00
_boot.py ports: Use vfs module instead of os. 2024-02-07 13:25:09 +11:00
rp2.py rp2/modules/rp2.py: Don't corrupt globals on asm_pio() exception. 2026-03-05 00:07:14 +11:00