-
Notifications
You must be signed in to change notification settings - Fork 89
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
OpenThread Fixes and Updates #447
Merged
Merged
Conversation
This file contains 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
tyler-potyondy
force-pushed
the
openthread-dev
branch
from
June 20, 2024 22:55
9c14ba4
to
6428f74
Compare
bradjc
reviewed
Jun 21, 2024
libopenthread/platform/plat.h
Outdated
bool pending_rx_done_callback_status(void); | ||
void reset_pending_rx_done_callback(void); | ||
|
||
bool pending_libtock_sys_work(void); |
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.
Suggested change
bool pending_libtock_sys_work(void); | |
// Check if there are pending events that need to be handled before | |
// calling yield(). These events can be generated if the application happens | |
// to call yield() somewhere besides the main OpenThread loop. | |
bool openthread_platform_pending_work(void); |
Since this is public can we namespace this function?
Looks good. |
+1 to @bradjc's comment and overall approval otherwise. |
In the prior design, the libopenthread callbacks would call openthread "notifier" methods (e.g. `otPlatAlarmFired()`. OpenThread would then executing OpenThread related work and potentially dispatch sync functions such as printf for operations such as logging or sync radio operation. This refactors libopenthread to: - set flags for pending completed operations that need to be handled by OpenThread - no longer use sync radio functionality
-Revert to simpler logging that utilizes sync printf. This is now possible because all callbacks are avoid sync operations and set flags that are polled. -Prior to yielding, confirm no pending system or openthread work.
- thread tutorial app refactored to remove callback sync code
tyler-potyondy
force-pushed
the
openthread-dev
branch
from
June 27, 2024 21:50
6428f74
to
39008bb
Compare
alevy
approved these changes
Jun 28, 2024
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 PR refactors the libopenthread platform to embrace an async design. The prior implementation included some potentially sync/yielding code within callbacks. Now, these callbacks (radio, alarm, etc) set flags that are then polled during the "libopenthread work" of the the openthread main loop.
Additionally, the 15.4 raw driver merged recently and corresponding changes caused OpenThread to no longer transmit/receive. This was due to OpenThread requesting to sleep the radio (i.e. turn it off), but failed to power the radio on again before requesting to tx/rx. This is now fixed in this PR.
The openthread_hello and tutorial openthread apps were updated respectively.