-
Notifications
You must be signed in to change notification settings - Fork 156
handle register derivedFrom #193
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
src/generate/peripheral.rs
Outdated
use syn::{self, Ident}; | ||
|
||
use errors::*; | ||
use util::{self, ToSanitizedSnakeCase, ToSanitizedUpperCase, BITS_PER_BYTE}; | ||
|
||
use generate::register; | ||
|
||
// This is a clone of the helper function from https://github.com/japaric/svd/pull/49 | ||
// and can go away once that is resolved | ||
fn derive_peripheral(p: &Peripheral, other: &Peripheral) -> Peripheral { |
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.
This has been merged in svd
I rebased and updated this PR. It is required in order for the GPIO pin registers to be generated correctly for atsamd21. |
This is a very basic first cut at expanding registers with derivedFrom. This commit requires rust-embedded/svd#50
e1dddc5
to
cb134d2
Compare
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.
Whoops, reviewing atm.
@@ -33,5 +33,5 @@ either = "1.0.3" | |||
error-chain = "0.11.0" | |||
inflections = "1.1.0" | |||
quote = "0.3.15" | |||
svd-parser = "0.6" | |||
svd-parser = { git = "https://github.com/japaric/svd" } |
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.
Git version here means we can't publish this to crates.io, perhaps we need to an svd-parser release?
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.
(cc. @Emilgardis)
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.
Yeah, this is gross. The problem is that svd-parser master hasn't been published in a while; the derive_from
method that we need was added a long time ago but still isn't available.
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.
Mhmm, I am almost completely at fault for that sorry :-/
Have been looking at it again today, but I think I need to learn a bunch more about SVD files to get it finished.
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.
No worries; I know exactly how it goes :-) I have my own branch that I've been using in the meantime, so it's not a critical blocker for my projects.
Ping from triage: Look that we are waiting on 2 things. First the PR: #256 and a new release of svd-parser. @rust-embedded/tools can someone let know if a new release of svd-parser is done and @wez can you then check that you can use the new release. |
@mathk yes, svd-parser v0.7.0 was released last month. There have been no new commits since that release. |
@wez You can bump the svd-parse version and see if that suite you |
I believe that this is obsoleted by the more current #256 |
Ahh, I was thinking concentric PRs rather than a PR including previous commits, thanks for pointing that out! |
#256 is the successor to this, so closing this one out |
Building on #190 (the bottom two commits are basically that PR), this PR adds support for generating code for registers that have the derivedFrom attribute set on them.
This is needed to resolve the
WARNING: field Some(Ident("pmux1_1")) has different offset 177 than its union container 176
mentioned in #192