From ded8bbdd5efc50d2b86e3020462ced8bbcf4d25c Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Mon, 16 Sep 2024 13:39:13 +0100 Subject: [PATCH] rp2/machine_pin_cyw43: Include check for CYW43_GPIO. The `#if` check only checks that `MICROPY_PY_NETWORK_CYW43` and `MICROPY_HW_PIN_EXT_COUNT` are defined. This is a reasonable assumption for the Pico W, but causes conflicts if someone wants to attach an external IO expander to their Pico W and have its pins appear as Pin objects. This commit addresses this by adding the additional checks, letting board builds include wireless but separately choose whether the external IO pins come from the cyw43 or not. Signed-off-by: Christopher Parrott --- ports/rp2/machine_pin_cyw43.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/rp2/machine_pin_cyw43.c b/ports/rp2/machine_pin_cyw43.c index c09561461..9fc262454 100644 --- a/ports/rp2/machine_pin_cyw43.c +++ b/ports/rp2/machine_pin_cyw43.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "py/mphal.h" -#if defined(MICROPY_PY_NETWORK_CYW43) && defined(MICROPY_HW_PIN_EXT_COUNT) +#if defined(MICROPY_PY_NETWORK_CYW43) && defined(MICROPY_HW_PIN_EXT_COUNT) && defined(CYW43_GPIO) && CYW43_GPIO == 1 #include "modmachine.h" #include "machine_pin.h" @@ -83,4 +83,4 @@ void machine_pin_ext_config(machine_pin_obj_t *self, int mode, int value) { } } -#endif // defined(MICROPY_PY_NETWORK_CYW43) && defined(MICROPY_HW_PIN_EXT_COUNT) +#endif // defined(MICROPY_PY_NETWORK_CYW43) && defined(MICROPY_HW_PIN_EXT_COUNT) && defined(CYW43_GPIO) && CYW43_GPIO == 1