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>
This commit is contained in:
ZodiusInfuser 2024-09-16 13:39:13 +01:00 committed by Damien George
parent 79ba6d8ce7
commit ded8bbdd5e

View File

@ -30,7 +30,7 @@
#include "py/runtime.h" #include "py/runtime.h"
#include "py/mphal.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 "modmachine.h"
#include "machine_pin.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