pico-sdk/tools/pioasm
Uri Shaked 4328b2c75f
fix pioasm python output (#479)
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()
```
2021-06-07 22:02:04 -05:00
..
gen Initial Release 2021-01-20 10:44:27 -06:00
ada_output.cpp pioasm: Ada output format 2021-03-04 21:22:48 -06:00
c_sdk_output.cpp pio: Add 'pragma once' to generated header files (#237) 2021-03-08 12:21:36 -06:00
CMakeLists.txt pioasm: Ada output format 2021-03-04 21:22:48 -06:00
hex_output.cpp Initial Release 2021-01-20 10:44:27 -06:00
lexer.ll Initial Release 2021-01-20 10:44:27 -06:00
main.cpp remove static order dependency 2021-02-01 14:46:45 -06:00
output_format.h remove static order dependency 2021-02-01 14:46:45 -06:00
parser.yy Initial Release 2021-01-20 10:44:27 -06:00
pio_assembler.cpp remove static order dependency 2021-02-01 14:46:45 -06:00
pio_assembler.h Initial Release 2021-01-20 10:44:27 -06:00
pio_disassembler.cpp Push/Pull disassembly no longer incorrectly concatenates operands in disassembly 2021-02-01 14:46:45 -06:00
pio_disassembler.h Initial Release 2021-01-20 10:44:27 -06:00
pio_types.h Initial Release 2021-01-20 10:44:27 -06:00
python_output.cpp fix pioasm python output (#479) 2021-06-07 22:02:04 -05:00