-
Notifications
You must be signed in to change notification settings - Fork 5
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
Re-generate register mappings with svd2rust 0.30.2 #46
Merged
epontan
merged 3 commits into
GrepitAB:master
from
Ironedde:atempt2-update-svd2rust-and-form
Mar 4, 2024
Merged
Re-generate register mappings with svd2rust 0.30.2 #46
epontan
merged 3 commits into
GrepitAB:master
from
Ironedde:atempt2-update-svd2rust-and-form
Mar 4, 2024
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
In the past we have introduced build and/or clippy fixes ourselfs through individual patches. Some of these include: fa62200 Fix clippy::unnecessary_cast, added in svd2rust 0.27.0) e50754a Fix clippy::explicit_auto_deref, added in svd2rust 0.27.0) c4a8906 Added Eq implementation, added in svd2rust 0.26.0 But since all these have been added up until svd2rust 0.30.2, and beacuse `clippy::missing_safety_doc` has started causing our PR's to fail CI, it was decided to make a step in svd2rust versions. Summary of changes in this commit: * Create a SVD export using svd2rust 0.30.2 and form 0.10.0 * Copy generic.rs to mcan/src/reg/ * Copy generic/ to mcan/src/reg/ * Overwrite rxf{a,c,s}.rs with rxf0{a,c,s}.rs Note: This update is based on the SVD file[1] used by the atsame51n pac crate (0.13.0) [1] https://github.com/atsamd-rs/atsamd/blob/b138702539afa9ec12f17aa5b2765f59289b83ce/svd/ATSAME51N19A.svd
* Re-apply the merge the two FIFO queues (57d1266) * Re-apply fix for docs relating to the move into reg module, along with wrong docs for tdcr (2dcd7a3) * Re-apply the item-level docs for `generics.rs` * Remove customer specific register information from `cust.rs` * Fix build errors that was caused by the svd2rust update
epontan
approved these changes
Mar 4, 2024
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.
Looks great, @Ironedde! Well done 👍
vcrn
approved these changes
Mar 4, 2024
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.
Looks good, well done!
7 tasks
Ironedde
added a commit
to Ironedde/mcan-clone
that referenced
this pull request
Mar 4, 2024
- Add safe way to shutdown the bus when actively transmitting/receiving (GrepitAB#45) - Add method to finalize configuration into initialization mode (GrepitAB#47) - *Breaking* Update the register mappings with svd2rust 0.30.2 and form 0.10.0 (GrepitAB#46)
Ironedde
added a commit
to Ironedde/mcan-clone
that referenced
this pull request
Mar 4, 2024
- Add safe way to shutdown the bus when actively transmitting/receiving (GrepitAB#45) - Add method to finalize configuration into initialization mode (GrepitAB#47) - *Breaking* Update the register mappings with svd2rust 0.30.2 and form 0.10.0 (GrepitAB#46)
Ironedde
added a commit
that referenced
this pull request
Mar 4, 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.
Why do we want to do this?
In the past we have introduced build and/or clippy fixes ourselfs
through individual patches. Some of these include:
fa62200 Fix clippy::unnecessary_cast, added in svd2rust 0.27.0)
e50754a Fix clippy::explicit_auto_deref, added in svd2rust 0.27.0)
c4a8906 Added Eq implementation, added in svd2rust 0.26.0
But since all these have been added up until
svd2rust 0.30.2
, and beacuseclippy::missing_safety_doc
has started causing our PR's to fail CI, it makes sense to step up the mappings and make use of the new changes.What is changing?
Since we are stepping the version of the generating tool of the register mappings themselfs, we can expect there to be some breaking changes here.
One example is in
mcan::reg::psr::LEC_A
which changes name toLECSELECT_A
.The API for the main functionality of the mcan crate will be left unchanged and hopefully this will mean that most users don't need to spend much time to update their codebase.
How do we accomplish this?
Since we have modified some structures in the generated code to fit with our use case there are some manual additions we need to make after we use
svd2rust
andform
.So the full process becomes:
svd2rust 0.30.2
andform 0.10.0
generic.rs
tomcan/src/reg/
generic/
tomcan/src/reg/
rxf{a,c,s}.rs
withrxf0{a,c,s}.rs
with wrong docs for tdcr (2dcd7a3)
generics.rs
cust.rs
Note: This update is based on the SVD file used by the atsame51n pac
crate (0.13.0).
There are newer files available, but these does not contain changes that concerns the MCAN peripheral.
Thank you!
Thank you for your contribution.
Please make sure that your submission includes the following:
Must
errors
orwarnings
.cargo +stable fmt
was run.cargo +stable clippy
yields nowarnings
.CHANGELOG.md
in the proper section.newly added features and code.