8000 rp2/machine_pin: Change N_GPIOS to NUM_BANK0_GPIOS for pico-sdk compat. · micropython/micropython@c9210a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit c9210a6

Browse files
lurchdpgeorge
authored andcommitted
rp2/machine_pin: Change N_GPIOS to NUM_BANK0_GPIOS for pico-sdk compat.
This fixes machine_pin.c to build against the new pico-sdk coming down the pipeline, whilst still working with the existing version.
1 parent ffded48 commit c9210a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/rp2/machine_pin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ typedef struct _machine_pin_irq_obj_t {
7171

7272
STATIC const mp_irq_methods_t machine_pin_irq_methods;
7373

74-
STATIC const machine_pin_obj_t machine_pin_obj[N_GPIOS] = {
74+
STATIC const machine_pin_obj_t machine_pin_obj[NUM_BANK0_GPIOS] = {
7575
{{&machine_pin_type}, 0},
7676
{{&machine_pin_type}, 1},
7777
{{&machine_pin_type}, 2},
@@ -134,7 +134,7 @@ void machine_pin_init(void) {
134134
}
135135

136136
void machine_pin_deinit(void) {
137-
for (int i = 0; i < N_GPIOS; ++i) {
137+
for (int i = 0; i < NUM_BANK0_GPIOS; ++i) {
138138
gpio_set_irq_enabled(i, GPIO_IRQ_ALL, false);
139139
}
140140
irq_set_enabled(IO_IRQ_BANK0, false);

0 commit comments

Comments
 (0)
0