Skip to content

ports/rp2: Include check for CYW43_GPIO in machine_pin_cyw43.c #15854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ZodiusInfuser
Copy link
Contributor

When doing some experiments with IO expander support for the Pimoroni Yukon, I discovered that the #if check in machine_pin_cyw43.c 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 (such as myself) wants to attach an external IO expander to their Pico W and have its pins appear as Pin objects.

This PR addresses this by adding the additional checks for defined(CYW43_GPIO) && CYW43_GPIO == 1 to machine_pin_cyw43.c letting board builds include wireless but separately choose whether the external IO pins come from the cyw43 or not.

The long term solution of course would be to allow for multiple external pin types, but that feels like a bigger discussion, and is more than I currently require anyway.

Signed-off-by: Christopher Parrott <chris@pimoroni.com>
Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS

@dpgeorge
Copy link
Member

Thanks, rebased and merged in ded8bbd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants