Skip to content

Commit dda05c3

Browse files
soypatdeadprogram
authored andcommitted
irq wait bit shift fix
1 parent cfbe6c4 commit dda05c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rp2-pio/instrv1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (asm AssemblerV1) IRQWait(irqIndex uint8, idxMode IRQIndexMode) instruction
123123
}
124124

125125
func (asm AssemblerV1) irq(clear, wait bool, irqIndex uint8, idxMode IRQIndexMode) instructionV0 {
126-
instr := _INSTR_BITS_IRQ | uint16(boolAsU8(clear))<<6 | uint16(boolAsU8(wait))<<6 | uint16(idxMode)<<3 | uint16(irqIndex&0b111)
126+
instr := _INSTR_BITS_IRQ | uint16(boolAsU8(clear))<<6 | uint16(boolAsU8(wait))<<5 | uint16(idxMode&0b11)<<3 | uint16(irqIndex&0b111)
127127
return asm.v0().instr(instr)
128128
}
129129

0 commit comments

Comments
 (0)