8000 More fixes for bad PINMASK_IS_SET macro · adafruit/circuitpython@2b396f2 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 2b396f2

Browse files
committed
More fixes for bad PINMASK_IS_SET macro
these were inverted but didn't notice before since the macro was too
1 parent 455dd22 commit 2b396f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void _reset_statemachine(PIO pio, uint8_t sm, bool leave_pins) {
144144

145145
pio_pinmask_t pins = _current_sm_pins[pio_index][sm];
146146
for (size_t pin_number = 0; pin_number < NUM_BANK0_GPIOS; pin_number++) {
147-
if (PIO_PINMASK_IS_SET(pins, pin_number)) {
147+
if (!PIO_PINMASK_IS_SET(pins, pin_number)) {
148148
continue;
149149
}
150150
_pin_reference_count[pin_number]--;
@@ -372,7 +372,7 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self,
372372
self->pull_pin_down = pull_pin_down;
373373

374374
for (size_t pin_number = 0; pin_number < NUM_BANK0_GPIOS; pin_number++) {
375-
if (PIO_PINMASK_IS_SET(pins_we_use, pin_number)) {
375+
if (!PIO_PINMASK_IS_SET(pins_we_use, pin_number)) {
376376
continue;
377377
}
378378
const mcu_pin_obj_t *pin = mcu_get_pin_by_number(pin_number);

0 commit comments

Comments
 (0)
0