pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

irq clear prev not working

Open pauldevine opened this issue 8 months ago • 3 comments

On the rp2350b I'm synchronizing two state machines on different PIO instances so that they can address different pin ranges. 0-31 with one state machine and 32-47 on the other. I'm able to successfully set an interrupt and have it triggered on the second machine across the PIO boundary. But I'm not able to clear it with irq clear. The compiler won't allow me to reference the previous pio block with:

.wrap_target
    wait 0 irq prev 0      ; Wait for IRQ0
    irq clear prev 0        ; Clear IRQ0
.wrap

that results in a syntax error 15-18: syntax error, unexpected prev, expecting ( or identifier or integer. I get the same syntax error if I try the documented irq clear 0 prev. Since the word prev seems to work for the other statements when it precedes the interrupt number I assumed that syntax should be valid here.

I can get the pio assembly to compile if I use irq prev clear 0 however that doesn't clear the interrupt.

If instead I clear the interrupt immediately with wait 1 irq prev 0 that works as expected. I was hoping to have a few pio commands executed before clearing the interrupt as I'm trying to get a bus to the right state before continuing the other state machine.

pauldevine avatar Mar 09 '25 00:03 pauldevine