Skip to content

Commit cf81c94

Browse files
authored
Merge pull request #5 from dglaude/patch-1
Fix for "; comment only lines"
2 parents e0c625c + 4ceb54b commit cf81c94

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

adafruit_pioasm.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ def assemble(text_program):
5353
sideset_count = int(line.split()[1])
5454
elif line.endswith(":"):
5555
labels[line[:-1]] = len(instructions)
56-
else:
56+
elif line:
57+
# Only add as an instruction if the line isn't empty
5758
instructions.append(line)
5859

5960
max_delay = 2 ** (5 - sideset_count) - 1
6061
assembled = []
6162
for instruction in instructions:
62-
print(instruction)
63+
# print(instruction)
6364
instruction = instruction.split()
6465
delay = 0
6566
if instruction[-1].endswith("]"): # Delay
@@ -162,6 +163,6 @@ def assemble(text_program):
162163
else:
163164
raise RuntimeError("Unknown instruction:" + instruction)
164165
assembled[-1] |= delay << 8
165-
print(hex(assembled[-1]))
166+
# print(hex(assembled[-1]))
166167

167168
return array.array("H", assembled)

0 commit comments

Comments
 (0)