Skip to content

Commit fe23bd7

Browse files
committed
Workaround no longer needed
1 parent 9c42a48 commit fe23bd7

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,6 @@ static void *_interrupt_arg[NUM_PIOS][NUM_PIO_STATE_MACHINES];
6464

6565
static void rp2pio_statemachine_interrupt_handler(void);
6666

67-
// Workaround for sdk bug: https://github.com/raspberrypi/pico-sdk/issues/1878
68-
// This workaround can be removed when we upgrade to sdk 2.0.1
69-
static inline void sm_config_set_in_pin_count_issue1878(pio_sm_config *c, uint in_count) {
70-
#if PICO_PIO_VERSION == 0
71-
// can't be changed from 32 on PIO v0
72-
((void)c);
73-
valid_params_if(HARDWARE_PIO, in_count == 32);
74-
#else
75-
valid_params_if(HARDWARE_PIO, in_count && in_count <= 32);
76-
c->shiftctrl = (c->shiftctrl & ~PIO_SM0_SHIFTCTRL_IN_COUNT_BITS) |
77-
((in_count & 0x1fu) << PIO_SM0_SHIFTCTRL_IN_COUNT_LSB);
78-
#endif
79-
}
8067
static void rp2pio_statemachine_set_pull(pio_pinmask_t pull_pin_up, pio_pinmask_t pull_pin_down, pio_pinmask_t pins_we_use) {
8168
for (size_t i = 0; i < NUM_BANK0_GPIOS; i++) {
8269
bool used = PIO_PINMASK_IS_SET(pins_we_use, i);
@@ -442,7 +429,7 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self,
442429
sm_config_set_wrap(&c, wrap_target, wrap);
443430
sm_config_set_in_shift(&c, in_shift_right, auto_push, push_threshold);
444431
#if PICO_PIO_VERSION > 0
445-
sm_config_set_in_pin_count_issue1878(&c, in_pin_count);
432+
sm_config_set_in_pin_count(&c, in_pin_count);
446433
#endif
447434

448435
sm_config_set_out_shift(&c, out_shift_right, auto_pull, pull_threshold);

0 commit comments

Comments
 (0)