Merge pull request #6863 from jepler/rp2pio-erroneous-mask
rp2pio: fix occasional bug when not using OUT pins
This commit is contained in:
commit
449b43e5a6
@ -369,6 +369,9 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self,
|
||||
}
|
||||
|
||||
static uint32_t mask_and_rotate(const mcu_pin_obj_t *first_pin, uint32_t bit_count, uint32_t value) {
|
||||
if (!first_pin) {
|
||||
return 0;
|
||||
}
|
||||
value = value & ((1 << bit_count) - 1);
|
||||
uint32_t shift = first_pin->number;
|
||||
return value << shift | value >> (32 - shift);
|
||||
|
Loading…
Reference in New Issue
Block a user