pio: allow programs with 32 instructions (#236)

This commit is contained in:
Christian Flach 2021-03-08 19:48:28 +01:00 committed by GitHub
parent 090c5cd83b
commit 6f7dc67791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,7 +54,7 @@ static_assert(PIO_INSTRUCTION_COUNT <= 32, "");
static uint32_t _used_instruction_space[2]; static uint32_t _used_instruction_space[2];
static int _pio_find_offset_for_program(PIO pio, const pio_program_t *program) { static int _pio_find_offset_for_program(PIO pio, const pio_program_t *program) {
assert(program->length < PIO_INSTRUCTION_COUNT); assert(program->length <= PIO_INSTRUCTION_COUNT);
uint32_t used_mask = _used_instruction_space[pio_get_index(pio)]; uint32_t used_mask = _used_instruction_space[pio_get_index(pio)];
uint32_t program_mask = (1u << program->length) - 1; uint32_t program_mask = (1u << program->length) - 1;
if (program->origin >= 0) { if (program->origin >= 0) {