Merge pull request #6637 from jepler/issue-6636

It's OK for an init program to be zero bytes long
This commit is contained in:
Dan Halbert 2022-07-23 21:51:09 -04:00 committed by GitHub
commit b303d00bdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,7 +247,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
mp_raise_ValueError(translate("Program size invalid")); mp_raise_ValueError(translate("Program size invalid"));
} }
mp_arg_validate_length_range(init_bufinfo.len, 2, 64, MP_QSTR_init); mp_arg_validate_length_range(init_bufinfo.len, 0, 64, MP_QSTR_init);
if (init_bufinfo.len % 2 != 0) { if (init_bufinfo.len % 2 != 0) {
mp_raise_ValueError(translate("Init program size invalid")); mp_raise_ValueError(translate("Init program size invalid"));
} }