Skip to content

PrawnBlaster runviewer parser drops first instruction after a wait with timeout #109

Open
@dihm

Description

@dihm

Issue is in this if-elif-else block

for row in pulse_program:
if row["reps"] == 0 and not last_instruction_was_wait: # WAIT
last_instruction_was_wait = True
if clock is not None:
t = clock_ticks[trigger_index] + self.trigger_delay
trigger_index += 1
else:
t += self.wait_delay
elif last_instruction_was_wait:
# two waits in a row means an indefinite wait, so we just skip this
# instruction.
last_instruction_was_wait = False
continue
else:
last_instruction_was_wait = False
for i in range(row["reps"]):
for j in range(1, -1, -1):
time.append(t)
states.append(j)
t += row["half_period"] * clock_factor

The elif block always triggers on the next instruction after a wait, even if the current instruction is not also a wait (the proper indication of an indefinite wait).

Pretty sure the elif check should be elif row["reps"] == 0 and last_instruction_was_wait:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions