8000 Enable _bleio adapter when _bleio is imported by dhalbert · Pull Request #2647 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Enable _bleio adapter when _bleio is imported #2647

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

Merged
merged 1 commit into from
Feb 21, 2020

Conversation

dhalbert
Copy link
Collaborator
@dhalbert dhalbert commented Feb 21, 2020

Fixes #2646.

Uses MICROPY_MODULE_BUILTIN_INIT mechanism to call a native module __init__() function when the _bleio module is imported. The init function enables the Adapter, which enables the SD. This mechanism was disabled in all our ports before this PR, but might come in handy in other cases.

Also fixed one minor doc thing I found by accident.

@dhalbert dhalbert requested a review from tannewt February 21, 2020 02:58
Copy link
Member
@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Great solution! I hadn't seen the module __init__ mechanic.

@tannewt tannewt merged commit e9ade63 into adafruit:master Feb 21, 2020
@dhalbert dhalbert deleted the enable-bleio-adapter-on-import branch February 21, 2020 19:12
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.

PR #2644 (disable remote editing) is breaking BLE
2 participants
0