-
Notifications
You must be signed in to change notification settings - Fork 99
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
Agenda for 2020-01-14 meeting #413
Comments
We can also discuss rust-embedded/cortex-m#186 and https://github.com/rust-embedded/cortex-m-rt/issues/237 if we have time (they're also part of the road to 1.0). |
Speaking of changing the svd2rust generated code, I was thinking of changing the API of the register writers so that they make use of traits instead of endlessly chaining fields and values as method calls. So something like This makes the written code look somewhat cleaner IMO, but the real motivation is unblocking #289. Rustfmt makes the method-chaining-based API look very unreadable since it puts each method call in its own line (#289 (comment)). |
@jonas-schievink Updated accordingly. Feel free to update the issue yourself. |
Although of course you don't have to chain them.
I agree that |
I might be wrong but isn't My understanding was that that's the reason why things like |
No, both are entirely up to the optimizer. svd2rust marks all of those small functions |
I don't currently have a strong opinion, but I'd like to note that the proposed style requires the user to import the parameter types, which can be a hassle. (I just realize what I said doesn't apply to the example as shown, but I believe it's still valid in general, unless I misunderstand the proposal.) |
@hannobraun That's a good point actually! I think it does match other Rust builder patterns well though. There might also be a tradeoff regarding compile times here. Do the methods compile faster, or the trait-based approach? |
The more I think about this the more I think we should keep it as-is. Changing functional well understood code to workaround a formatter issue seems backwards. |
8-9 PM CET (Berlin time) on #rust-embedded:matrix.org
Public Google calendar that includes these weekly meetings
Agenda
cortex-m
exposes unsafe cache invalidation operations as safe "Invalidate Cache" operation is unsafe cortex-m#188svd2rust
generated code: Movegeneric.rs
contents to other crate svd2rust#427svd2rust
to reduce chaining (and formatting woes)embedded-hal
(aka gettting rid ofunproven
feature flag): [RFC] Changing the way we handle addition/changes to the traits embedded-hal#163Peripherals::{take, steal}
API cortex-m#186This meeting is open for anyone to attend. If you'd like to bring up any issue / topic related to embedded Rust leave a comment in this issue so we can add it to the agenda.
The text was updated successfully, but these errors were encountered: