Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

SDK • Re: PIO - Masking X register for JMP instruction

$
0
0
What about something like:

Code:

.wrap_targetloop:    ; Clear ISR.    mov isr, null    ; Sample current pin state into ISR.    in pins, 1    ; Place current pin state into X.    mov x, isr    ; If current pin state in X no longer matches previous pin state in Y then jump to pin_change.    jmp x!=y pin_change    ; Pin hasn't changes so loop around and sample again.    jmp looppin_change:    ; Push current pin state into FIFO for CPU to read.    push    ; Save current pin state away in the Y register which is used to track the previous pin state.    mov y, x.wrap

Statistics: Posted by adam_green — Sat Jan 13, 2024 2:53 am



Viewing all articles
Browse latest Browse all 8374

Trending Articles