Browse Source

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>
pull/15785/head
ZodiusInfuser 2 months ago
committed by Damien George
parent
commit
ded8bbdd5e
  1. 4
      ports/rp2/machine_pin_cyw43.c

4
ports/rp2/machine_pin_cyw43.c

@ -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

Loading…
Cancel
Save