rp2_common/hardware_pio/pio: Add 'pio_add_program_at_offset' implementation

pio_add_program_at_offset() had a prototype in the header, but was
missing an implementation in the C file.
This commit is contained in:
Joe Komlodi 2021-01-30 23:31:24 -10:00 committed by Luke Wren
parent ee16a8c370
commit c5f8527145

View File

@ -124,6 +124,13 @@ uint pio_add_program(PIO pio, const pio_program_t *program) {
return offset;
}
void pio_add_program_at_offset(PIO pio, const pio_program_t *program, uint offset)
{
uint32_t save = hw_claim_lock();
_pio_add_program_at_offset(pio, program, offset);
hw_claim_unlock(save);
}
void pio_remove_program(PIO pio, const pio_program_t *program, uint loaded_offset) {
uint32_t program_mask = (1u << program->length) - 1;
program_mask <<= loaded_offset;