@@ -56,16 +56,16 @@ pulse_loop:
56
56
57
57
% c-sdk {
58
58
static inline void hub75_row_program_init(PIO pio, uint sm, uint offset, uint row_base_pin, uint n_row_pins, uint latch_base_pin, uint latch_cycles) {
59
- pio_sm_set_consecutive_pindirs(pio, sm, row_base_pin, n_row_pins, true);
60
- pio_sm_set_consecutive_pindirs(pio, sm, latch_base_pin, 2, true);
59
+ pio_sm_set_consecutive_pindirs(pio, sm, row_base_pin - pio_get_gpio_base(pio) , n_row_pins, true);
60
+ pio_sm_set_consecutive_pindirs(pio, sm, latch_base_pin - pio_get_gpio_base(pio) , 2, true);
61
61
for (uint i = row_base_pin; i < row_base_pin + n_row_pins; ++i)
62
62
pio_gpio_init(pio, i);
63
63
pio_gpio_init(pio, latch_base_pin);
64
64
pio_gpio_init(pio, latch_base_pin + 1);
65
65
66
66
pio_sm_config c = hub75_row_program_get_default_config(offset);
67
- sm_config_set_out_pins(&c, row_base_pin, n_row_pins);
68
- sm_config_set_sideset_pins(&c, latch_base_pin);
67
+ sm_config_set_out_pins(&c, row_base_pin - pio_get_gpio_base(pio) , n_row_pins);
68
+ sm_config_set_sideset_pins(&c, latch_base_pin - pio_get_gpio_base(pio) );
69
69
sm_config_set_out_shift(&c, true, true, 32);
70
70
pio_sm_init(pio, sm, offset, &c);
71
71
pio_sm_exec(pio, sm, pio_encode_out(pio_y, 32));
@@ -135,15 +135,15 @@ public shift1: ; R1 G1 B1 (Bottom half of 64x64 displays)
135
135
136
136
% c-sdk {
137
137
static inline void hub75_data_rgb888_program_init(PIO pio, uint sm, uint offset, uint rgb_base_pin, uint clock_pin) {
138
- pio_sm_set_consecutive_pindirs(pio, sm, rgb_base_pin, 6, true);
139
- pio_sm_set_consecutive_pindirs(pio, sm, clock_pin, 1, true);
138
+ pio_sm_set_consecutive_pindirs(pio, sm, rgb_base_pin - pio_get_gpio_base(pio) , 6, true);
139
+ pio_sm_set_consecutive_pindirs(pio, sm, clock_pin - pio_get_gpio_base(pio) , 1, true);
140
140
for (uint i = rgb_base_pin; i < rgb_base_pin + 6; ++i)
141
141
pio_gpio_init(pio, i);
142
142
pio_gpio_init(pio, clock_pin);
143
143
144
144
pio_sm_config c = hub75_data_rgb888_program_get_default_config(offset);
145
- sm_config_set_out_pins(&c, rgb_base_pin, 6);
146
- sm_config_set_sideset_pins(&c, clock_pin);
145
+ sm_config_set_out_pins(&c, rgb_base_pin - pio_get_gpio_base(pio) , 6);
146
+ sm_config_set_sideset_pins(&c, clock_pin - pio_get_gpio_base(pio) );
147
147
sm_config_set_out_shift(&c, true, true, 32);
148
148
// ISR shift to left. R0 ends up at bit 5. We push it up to MSB and then flip the register.
149
149
sm_config_set_in_shift(&c, false, false, 32);
0 commit comments