Skip to content

Commit e4f2740

Browse files
authored
Fix wait source encoding
Change the wait instruction encoding to shift the source by 5 bits instead of 4.
1 parent 25618d8 commit e4f2740

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_pioasm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def assemble(text_program):
9696
if not 0 <= polarity <= 1:
9797
raise RuntimeError("Invalid polarity")
9898
assembled[-1] |= polarity << 7
99-
assembled[-1] |= WAIT_SOURCES.index(instruction[2]) << 4
99+
assembled[-1] |= WAIT_SOURCES.index(instruction[2]) << 5
100100
num = int(instruction[3])
101101
if not 0 <= num <= 31:
102102
raise RuntimeError("Wait num out of range")

0 commit comments

Comments
 (0)