Skip to content

Allow Selection of _bleio by Board, Fixup CIRCUITPY_BLEIO Flags#9878

Merged
dhalbert merged 5 commits into
adafruit:mainfrom
eightycc:bleio-build-fix
Apr 7, 2025
Merged

Allow Selection of _bleio by Board, Fixup CIRCUITPY_BLEIO Flags#9878
dhalbert merged 5 commits into
adafruit:mainfrom
eightycc:bleio-build-fix

Conversation

@eightycc

@eightycc eightycc commented Dec 7, 2024

Copy link
Copy Markdown

Allows selection of _bleio impementation by board within a port. Makes explicit HCI device inclusion by replacing use of vpath.

Changes meanings of CIRCUITPY_BLEIO* flags as follows:

  • CIRCUITPY_BLEIO: Any _bleio implementation is part of this build. Automatically set.
  • CIRCUITPY_BLEIO_NATIVE: Selects the port's native _bleio implementation.
  • CIRCUITPY_BLEIO_HCI: Selects the serial HCI implementation.

@eightycc

eightycc commented Dec 7, 2024

Copy link
Copy Markdown
Author

Marked as work in progress. Using CI to verify correct builds for all ports/boards.

@dhalbert

dhalbert commented Mar 28, 2025

Copy link
Copy Markdown
Collaborator

@eightycc I was going to do this and then saw you already did! It just needs a merge conflict fixed.

I would also like to get the Module Support Matrix to include an annotation that describes which _bleio is actually supported. This PR will make that easier: we can add entries to ADDITIONAL_MODULES in docs/shared_bindings_matrix.py like:

    "_bleio (native)": "CIRCUITPY_BLEIO_NATIVE",
    "_bleio (HCI co-processor)": "CIRCUITPY_BLEIO_HCI",

I also had another thought, which I'm not sure is a good idea at all, but is an idea. Asking @tannewt also:

EDIT: as described in #10218, I don't think is such a great idea:

Suppose _bleio for HCI was actually called _bleio_hci. The libraries would do something like:

try:
    import _bleio
except ImportError
    import _bleio_hci as _bleio

Conceivably, one could make a build that would support both, though it's not of much use (though there are compile issues about that, so you don't have to duplicate the shared-bindings code).

@eightycc

Copy link
Copy Markdown
Author

Like Barliman Butterbur in LOTR, I completely forgot about this one. One thing drives out another! I'll pick it up again, if you'd like.

@eightycc eightycc changed the base branch from main to 9.2.x March 31, 2025 12:54
@eightycc eightycc marked this pull request as ready for review March 31, 2025 13:58
@eightycc eightycc requested a review from dhalbert March 31, 2025 13:59
@eightycc eightycc changed the base branch from 9.2.x to main April 2, 2025 15:51
@eightycc

eightycc commented Apr 2, 2025

Copy link
Copy Markdown
Author

@dhalbert I'm splitting this. This PR covers the original change plus the recommended support matrix update. I'll open a separate issue for _bleio vs. _bleio_hci change as this will likely require some churn before we get it right.

@eightycc eightycc changed the title Allow Selection of _bleio by Board, Fixup CIRCUITPY_BLEIO Flags Fixup CIRCUITPY_BLEIO Flags Apr 2, 2025
@eightycc eightycc changed the title Fixup CIRCUITPY_BLEIO Flags Allow Selection of _bleio by Board, Fixup CIRCUITPY_BLEIO Flags Apr 2, 2025
@eightycc

eightycc commented Apr 7, 2025

Copy link
Copy Markdown
Author

@dhalbert Pinging for a review.

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this looks good, going on my recollections of the previous PR. Thanks!

@dhalbert dhalbert merged commit c286fc4 into adafruit:main Apr 7, 2025
@dhalbert

dhalbert commented Apr 8, 2025

Copy link
Copy Markdown
Collaborator

The disambiguated _bleio didn't show up exactly as I expected. It looks, for example, like this in https://docs.circuitpython.org/en/latest/shared-bindings/support_matrix.html:

image

@eightycc

eightycc commented Apr 8, 2025

Copy link
Copy Markdown
Author

The disambiguated _bleio didn't show up exactly as I expected.

@dhalbert I see the extra _bleio in the example and throughout. I'll need to dig into docs/shared_bindings_matrix.py to figure out why that's happening and follow up with an additional PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants