From c9210a65dfce0771186916a1d43cbf63133773ba Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 1 Feb 2021 18:21:12 +0000 Subject: [PATCH] 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. --- ports/rp2/machine_pin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/rp2/machine_pin.c b/ports/rp2/machine_pin.c index f798c10fdf..0525e0f9f6 100644 --- a/ports/rp2/machine_pin.c +++ b/ports/rp2/machine_pin.c @@ -71,7 +71,7 @@ typedef struct _machine_pin_irq_obj_t { STATIC const mp_irq_methods_t machine_pin_irq_methods; -STATIC const machine_pin_obj_t machine_pin_obj[N_GPIOS] = { +STATIC const machine_pin_obj_t machine_pin_obj[NUM_BANK0_GPIOS] = { {{&machine_pin_type}, 0}, {{&machine_pin_type}, 1}, {{&machine_pin_type}, 2}, @@ -134,7 +134,7 @@ void machine_pin_init(void) { } void machine_pin_deinit(void) { - for (int i = 0; i < N_GPIOS; ++i) { + for (int i = 0; i < NUM_BANK0_GPIOS; ++i) { gpio_set_irq_enabled(i, GPIO_IRQ_ALL, false); } irq_set_enabled(IO_IRQ_BANK0, false);