-
Notifications
You must be signed in to change notification settings - Fork 156
accessors everywhere (breaking) #692
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
r? @adamgreig (rust-highfive has picked a reviewer for you, use r? to override) |
What will it be like after this PR? From the brief intro, I imagine this: // error
uart.thr.write(...);
// correct
uart.thr().write(...); Is this the expected behavior? |
Yes |
Should we keep register blocks public under some feature gate? Rust kernel developers may still reuse this structure when writing drivers, as in this purpose the base address of peripherals are not fixed as bare metal when MMU comes in. |
It seems this PR only makes the |
I don't insist on this PR. It is just concept for discuss. |
cc @rust-embedded/tools |
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.
It's a big breaking change to the syntax, but I think it should be a fairly easy change for users to make in their code, and importantly it moves us to the syntax we'll need to get rid of memory-mapped structs. I can't see any way to keep the current syntax but not have memory-mapped structs.
I guess if someone needs a pointer to a field, they can still call as_ptr()
on what the accessor returns?
Should be same as before. |
All register/cluster access through methods. RegisterBlock fields are private
To access register or cluster instead of:
use