diff options
| author | Adam Green <adamgrym@yahoo.com> | 2023-04-20 22:23:46 -0700 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-05-18 12:33:02 +1000 |
| commit | f9958417d8adb21147de776361a4414073cf7c77 (patch) | |
| tree | a8dbafd8fe471cff3dd28c98b0057b1b1f6637ba /tests/io/file_seek.py | |
| parent | 3229791b60185faa47d87af80b6a8ccbb34d15e5 (diff) | |
rp2: Make rp2_state_machine_exec accept integers.
Currently rp2.StateMachine.exec(instr_in) requires that the instr_in
parameter be a string representing the PIO assembly language instruction
to be encoded by rp2.asm_pio_encode(). This commit allows the parameter
to also be of integral type. This is useful if the exec() method is
being called often where the use of pre-encoded machine code is
desireable.
This commit still supports calls like:
sm.exec("set(0, 1)")
It also now supports calls like:
# Performed once earlier, maybe in __init__()
assembled_instr = rp2.asm_pio_encode("out(y, 8)", 0)
# Performed multiple times later as the PIO state machine is
# configured for its next run.
sm.exec(assembled_instr)
The existing examples/rp2/pio_exec.py and examples/rp2/pio_pwm.py that
exercise the rp2.StateMachine.exec() method still work with this change.
Signed-off-by: Adam Green <adamgrym@yahoo.com>
Diffstat (limited to 'tests/io/file_seek.py')
0 files changed, 0 insertions, 0 deletions
