-
Notifications
You must be signed in to change notification settings - Fork 3k
BLE - Notify HCI driver of host stack inactivity #10162
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
Conversation
This callback should be called by the host stack when it has no pending activities. It allows a driver to put its controller to sleep.
@pan-, thank you for your changes. |
@@ -564,6 +564,9 @@ void BLE::callDispatcher() | |||
timestamp_t nextTimestamp = (timestamp_t) (WsfTimerNextExpiration(&pTimerRunning) * WSF_MS_PER_TICK) * 1000; | |||
if (pTimerRunning) { | |||
nextTimeout.attach_us(timeoutCallback, nextTimestamp); | |||
} else { | |||
critical_section.disable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this, or CriticalSectionLock critical_section;
needed to begin with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our case wsfOsReadyToSleep
and WsfTimerNextExpiration
needs to be called within a critical section.
CI started |
Test run: SUCCESSSummary: 13 of 13 test jobs passed |
…ivity BLE - Notify HCI driver of host stack inactivity
Description
This PR adds a new function to the CordioHCIDriver interface:
on_host_stack_inactivity
. That function is called by the host stack when it becomes inactive. It leave the opportunity to the driver to put the controller to sleep if all the conditions are met. Activity is resumed wheneverCordioHCIDriver::write
is called.This PR also fixes the type of the timeout local to
cardio::BLE::callDispatcher
.Pull request type
Reviewers
@paul-szczepanek-arm @ARMmbed/team-cypress