mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-02-18 21:40:43 +00:00
While working on the [online pioasm](https://wokwi.com/tools/pioasm), I found several PIO instructions that result in invalid python code. Here is a small program that demonstrate the issue: ``` .program python_issue push block wait 0 irq 1 rel irq clear 1 rel ``` And the resulting Python program: ```python # -------------------------------------------------- # # This file is autogenerated by pioasm; do not edit! # # -------------------------------------------------- # import rp2 from machine import Pin # ----------- # # python_test # # ----------- # @rp2.asm_pio() def python_test(): wrap_target() push(, block) # 0 wait(0, irq, 1 rel) # 1 irq(clear 1 rel) # 2 wrap() ``` After this fix, the above program compiles to a valid python syntax: ```python # -------------------------------------------------- # # This file is autogenerated by pioasm; do not edit! # # -------------------------------------------------- # import rp2 from machine import Pin # ----------- # # python_test # # ----------- # @rp2.asm_pio() def python_test(): wrap_target() push(block) # 0 wait(0, irq, rel(1)) # 1 irq(clear, rel(1)) # 2 wrap() ```