Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
facchinm merged 2 commits into arduino-libraries:master from sandeepmistry:cordio-timer
Dec 2, 2019

Conversation

Copy link
Contributor

@sandeepmistry sandeepmistry commented Nov 29, 2019

This resolves #33.

This pull request has two changes:

  1. It calls 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?)

  1. It reverts part of pull request cordio: lower power polling with timeout #15 . Unfortunately, the 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

Copy link
Collaborator

manchoz commented Nov 30, 2019

LGTM.

Fixes issues with async/callback code too.

Copy link
Contributor

facchinm commented 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 facchinm merged commit 8dc4290 into arduino-libraries:master Dec 2, 2019
facchinm added a commit to arduino/ArduinoCore-nRF528x-mbedos that referenced this pull request Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@facchinm facchinm facchinm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

BLE nano 33 does not report or disconnect from centra

AltStyle によって変換されたページ (->オリジナル) /