rp2/rp2_pio: Fix use of PIO2 in prog data structure.

The RP2350 PIO2 State Machines (8, 9, 10, 11) did not work.  The data
structure used to pass the PIO arguments was missing an entry for PIO2,
thus causing the PIO2 instances to write wrong data to wrong locations.

Fixes issue #17509.

Signed-off-by: Matt Westveld <github@intergalacticmicro.com>
This commit is contained in:
root 2025-06-17 23:17:43 -04:00 committed by Damien George
parent c9b52b2b7f
commit 769453c750
2 changed files with 9 additions and 7 deletions

View file

@ -7,12 +7,13 @@ from micropython import const
_PROG_DATA = const(0)
_PROG_OFFSET_PIO0 = const(1)
_PROG_OFFSET_PIO1 = const(2)
_PROG_EXECCTRL = const(3)
_PROG_SHIFTCTRL = const(4)
_PROG_OUT_PINS = const(5)
_PROG_SET_PINS = const(6)
_PROG_SIDESET_PINS = const(7)
_PROG_MAX_FIELDS = const(8)
_PROG_OFFSET_PIO2 = const(3)
_PROG_EXECCTRL = const(4)
_PROG_SHIFTCTRL = const(5)
_PROG_OUT_PINS = const(6)
_PROG_SET_PINS = const(7)
_PROG_SIDESET_PINS = const(8)
_PROG_MAX_FIELDS = const(9)
class PIOASMError(Exception):
@ -50,7 +51,7 @@ class PIOASMEmit:
| autopull << 17
| autopush << 16
)
self.prog = [array("H"), -1, -1, execctrl, shiftctrl, out_init, set_init, sideset_init]
self.prog = [array("H"), -1, -1, -1, execctrl, shiftctrl, out_init, set_init, sideset_init]
self.wrap_used = False

View file

@ -212,6 +212,7 @@ enum {
PROG_DATA,
PROG_OFFSET_PIO0,
PROG_OFFSET_PIO1,
PROG_OFFSET_PIO2,
PROG_EXECCTRL,
PROG_SHIFTCTRL,
PROG_OUT_PINS,