-
Notifications
You must be signed in to change notification settings - Fork 156
Register spec & traits #464
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
Looks good in first view. One question. Have you tested this for result firmware size? In release and debug mode. |
Edit: wow nope. My test setup was not properly pulling in the modified build. I thought it seemed suspicious how identical it was. Will reevaluate. |
arduino uno blink example
|
After
|
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.
bors r+
465: Accessor newtypes r=therealprof a=couchand Part 2 of #463, builds on #464. - Wraps register reader/writer and field readers in newtype wrappers, which significantly improves the documentation output. Again there's some minor potential for breaking changes: - If users named the complete type of the previous type alias, it would break. It seems more likely that they would use the alias, which will silently upgrade to a reference to the newtype. r? @burrbull Co-authored-by: Andrew Dona-Couch <hi@andrewcou.ch>
Part 1 of #463.
Reg
, making the register spec the sole authority on the shape of the register (but not its address).One thing that's changed since the previous PR, this renames the spec struct so that it won't cause a conflict on NXP, Freescale, and possibly other architectures. I've gone with
register::REGISTER_SPEC
since that seems reasonably clear and I can't think of how it would cause a conflict (but I'm ready to be proven wrong since I've tried several ideas only to be stymied by various architectures' oddball register naming patterns).I'd prefer the spec to be in the parent module, but I can't come up with a way to do that which guarantees that the generated code will be free from naming conflicts. This seems good enough, plus it maintains the rule that when we make up a name it belongs in the child mod (except for
RegisterBlock
).There is potential for breaking changes here, though the impact seems pretty minimal. Specifically:
mod generic
, their usage would break. Writing code referring to those traits was previously pretty awkward (see Register trait improvements #463), and this PR makes such usage much more ergonomic, so it would seem to be a net benefit.#[docs(hidden)]
spec struct the reference would break. I don't see why they would have done so.r? @burrbull