Skip to content

Commit

Permalink
More fixes for bad PINMASK_IS_SET macro
Browse files Browse the repository at this point in the history
these were inverted but didn't notice before since the macro was too
  • Loading branch information
jepler committed Jan 7, 2025
1 parent 455dd22 commit 2b396f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ports/raspberrypi/common-hal/rp2pio/StateMachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static void _reset_statemachine(PIO pio, uint8_t sm, bool leave_pins) {

pio_pinmask_t pins = _current_sm_pins[pio_index][sm];
for (size_t pin_number = 0; pin_number < NUM_BANK0_GPIOS; pin_number++) {
if (PIO_PINMASK_IS_SET(pins, pin_number)) {
if (!PIO_PINMASK_IS_SET(pins, pin_number)) {
continue;
}
_pin_reference_count[pin_number]--;
Expand Down Expand Up @@ -372,7 +372,7 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self,
self->pull_pin_down = pull_pin_down;

for (size_t pin_number = 0; pin_number < NUM_BANK0_GPIOS; pin_number++) {
if (PIO_PINMASK_IS_SET(pins_we_use, pin_number)) {
if (!PIO_PINMASK_IS_SET(pins_we_use, pin_number)) {
continue;
}
const mcu_pin_obj_t *pin = mcu_get_pin_by_number(pin_number);
Expand Down

0 comments on commit 2b396f2

Please sign in to comment.