Skip to content

Commit dce9396

Browse files
committed
issue #6538 loose bounds checking on WAIT PIO instruction
1 parent c1b0044 commit dce9396

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/raspberrypi/common-hal/rp2pio/StateMachine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self,
436436
if (first_in_pin == NULL) {
437437
mp_raise_ValueError_varg(translate("Missing first_in_pin. Instruction %d waits based on pin"), i);
438438
}
439-
if (wait_index > in_pin_count) {
439+
if (wait_index >= in_pin_count) {
440440
mp_raise_ValueError_varg(translate("Instruction %d waits on input outside of count"), i);
441441
}
442442
}

0 commit comments

Comments
 (0)