fix checking for in-pin

This commit is contained in:
Jeff Epler 2023-08-05 14:24:11 -05:00
parent a6e8619940
commit 9a354a4eb8
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -434,7 +434,7 @@ static void consider_instruction(introspect_t *state, uint16_t full_instruction,
mp_raise_ValueError_varg(translate("%q[%u] uses extra pin"), what, i);
}
if (wait_source == 1) { // Input pin
if (state->has_in_pin) {
if (!state->has_in_pin) {
mp_raise_ValueError_varg(translate("Missing first_in_pin. %q[%u] waits based on pin"), what, i);
}
if (wait_index >= state->in_pin_count) {