Skip to content

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

Closed
ZodiusInfuser wants to merge 1 commit into
micropython:masterfrom
pimoroni:patch_cyw43_pin
Closed

ZodiusInfuser wants to merge 1 commit into
micropython:masterfrom
pimoroni:patch_cyw43_pin

Conversation

@ZodiusInfuser

Copy link
Copy Markdown
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.

@github-actions

Copy link
Copy Markdown

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
Copy Markdown
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