Skip to content

Commit ded8bbd

Browse files
ZodiusInfuserdpgeorge
authored andcommitted
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>
1 parent 79ba6d8 commit ded8bbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/rp2/machine_pin_cyw43.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "py/runtime.h"
3131
#include "py/mphal.h"
3232

33-
#if defined(MICROPY_PY_NETWORK_CYW43) && defined(MICROPY_HW_PIN_EXT_COUNT)
33+
#if defined(MICROPY_PY_NETWORK_CYW43) && defined(MICROPY_HW_PIN_EXT_COUNT) && defined(CYW43_GPIO) && CYW43_GPIO == 1
3434

3535
#include "modmachine.h"
3636
#include "machine_pin.h"
@@ -83,4 +83,4 @@ void machine_pin_ext_config(machine_pin_obj_t *self, int mode, int value) {
8383
}
8484
}
8585

86-
#endif // defined(MICROPY_PY_NETWORK_CYW43) && defined(MICROPY_HW_PIN_EXT_COUNT)
86+
#endif // defined(MICROPY_PY_NETWORK_CYW43) && defined(MICROPY_HW_PIN_EXT_COUNT) && defined(CYW43_GPIO) && CYW43_GPIO == 1

0 commit comments

Comments
 (0)