-
Notifications
You must be signed in to change notification settings - Fork 2k
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
examples: Add asynchronous Rust example #20830
examples: Add asynchronous Rust example #20830
Conversation
It's not pretty that this has to take care of its own to enable the right portable-atomics; looking for better ways, but that shouldn't need to stop things here. |
C preprocessor defines in non-function form are assumed by C2Rust to be constant if they are an expression and not a statement; the LED_PORT was the only place in the code where that was wrong, and led to compiler errors due to the value not being constant. Altering the internal macro to use function form sidesteps that issue. The generally preferred alternative of using a `const` is unavailable in this case because the dereferencing operator is already part of the vendor header file cpu/stellaris_common/include/vendor/cortex-m4-def.h. The changed macro is documented as required by doccheck. The doccheck rule that grandfathered in the LED_PORT macro as allowed undocumented is not removed because it is also used in other board.h files.
14b58a6
to
a491841
Compare
Added Makefile.ci (a short one -- this is just firing a few timers), and rebased onto #20831 to avoid logging a BOARDS_BLACKLIST entry around through parallel development. |
On the caveat topic of not many wrappers being available, there is now a structured list at RIOT-OS/rust-riot-wrappers#111 |
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.
Code looks good to me and I trust your testing :)
I've taken this out of the merge queue for a moment (it's a few-minutes merge) because this PR includes #20831 commits as well. If you have reviewed both parts and are happy with them, please leave an ACK there too, and we can restart this PR's merge queue run. I don't know what'd would happen if a a PR (20831) gets merged by another PR without itself qualifying for lack of ACKs, it could leave the PR in a weird state. |
Thank you and mguetschow, both reviewed now, pressing the button. (With checks green, even if there is a fluke that keeps 20831 from being merged through the queue, and this one goes through, GitHub should recognize both as merged with all checks green). |
Contribution description
Async is a popular coding style in Rust. Basic support for it is provided in riot-wrappers, mainly deferring to embassy tools.
Testing procedure
Caveats
There are fewer components exposed for async than there are for synchronous code in the riot-wrappers. Nonetheless, this should be user visible, if only to find what users' priorities are in terms of added components.
[edit: This is based on #20829, only the most recent commit "counts"; I should probably rebase once that is merged so that GitHub shows things correctly][edit2: This is now blocked by #20831 to avoid merge races]