From 80eb1fede74df1a21f8e44144f71ee4d1b90cc51 Mon Sep 17 00:00:00 2001 From: Tinkerer Date: Sun, 28 Sep 2025 11:25:02 -0700 Subject: [PATCH] Fix EncodeDelay() The prior code always returned 0. Signed-off-by: Tinkerer --- rp2-pio/instr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rp2-pio/instr.go b/rp2-pio/instr.go index 4c3cca5..969e3ce 100644 --- a/rp2-pio/instr.go +++ b/rp2-pio/instr.go @@ -93,7 +93,7 @@ func encodeInstrAndSrcDest(instr uint16, dest SrcDest, value uint8) uint16 { } func EncodeDelay(cycles uint8) uint16 { - return 0b11111 & (uint16(cycles) << 8) + return uint16(0b11111&cycles) << 8 } func EncodeSideSet(bitCount, value uint8) uint16 {