diff options
author | ZodiusInfuser <christopher.parrott2@gmail.com> | 2024-09-16 13:39:13 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-09-19 12:58:43 +1000 |
commit | ded8bbdd5efc50d2b86e3020462ced8bbcf4d25c (patch) | |
tree | c2d210340817972a993a651e689b4cc30cc8a1a3 | |
parent | 79ba6d8ce7f322baa8d606e52672c1bd4b245bb0 (diff) | |
download | micropython-ded8bbdd5efc50d2b86e3020462ced8bbcf4d25c.tar.gz micropython-ded8bbdd5efc50d2b86e3020462ced8bbcf4d25c.zip |
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 <chris@pimoroni.com>
-rw-r--r-- | ports/rp2/machine_pin_cyw43.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/rp2/machine_pin_cyw43.c b/ports/rp2/machine_pin_cyw43.c index c09561461f..9fc262454f 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 |