-
Notifications
You must be signed in to change notification settings - Fork 223
Cordio: BLE thread loop fixes #44
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LGTM.
Fixes issues with async/callback code too.
facchinm
facchinm
approved these changes
Dec 2, 2019
Looks perfect, I'm merging it and then performing all the necessary power usage tests to make sure we didn't regress.
facchinm
added a commit
to arduino/ArduinoCore-nRF528x-mbedos
that referenced
this pull request
Dec 2, 2019
Restore BLE low power functionality after arduino-libraries/ArduinoBLE#44
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This resolves #33.
This pull request has two changes:
timer.start()
in the BLE thread loop. Without this,timer.read_high_resolution_us()
always returns 0.Note: the issue is also present in the mbed sample code the HCI transport was based on: https://github.com/ARMmbed/mbed-os-cordio-hci-passthrough/blob/fix-wsf-msg/main.cpp#L86 (@facchinm should we inform them?)
WSF_MS_PER_TICK
needs to match the value mbed was compiled with for the supervision timeout to match: https://github.com/ARMmbed/mbed-os/blob/19e762298f9a020606f7358539bb653be0de8e4f/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn.c#L1168-L1174@facchinm I think we should measure the power consumption again. Then re-compile mbed if we need to adjust the value.
It's currently set to 1 ms:
however, the default appears to 10 ms: https://github.com/arduino/ArduinoCore-nRF528x-mbedos/blob/beac74ca3cd9d07363f66cf9cda6b143e4385cd2/cores/arduino/mbed/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_timer.h#L40