8000 Merge pull request #6863 from jepler/rp2pio-erroneous-mask · pepijndevos/circuitpython@449b43e · GitHub
[go: up one dir, main page]

Skip to content

Commit 449b43e

Browse files
authored
Merge pull request adafruit#6863 from jepler/rp2pio-erroneous-mask
rp2pio: fix occasional bug when not using OUT pins
2 parents d3626f1 + a3e1718 commit 449b43e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ports/raspberrypi/common-hal/rp2pio/StateMachine.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self,
369369
}
370370

371371
static uint32_t mask_and_rotate(const mcu_pin_obj_t *first_pin, uint32_t bit_count, uint32_t value) {
372+
if (!first_pin) {
373+
return 0;
374+
}
372375
value = value & ((1 << bit_count) - 1);
373376
uint32_t shift = first_pin->number;
374377
return value << shift | value >> (32 - shift);

0 commit comments

Comments
 (0)
0