Skip to content

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

Closed
wants to merge 4 commits into from

Conversation

wez
Copy link
Contributor

@wez wez commented Mar 15, 2018

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

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 {
Copy link
Member

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

@wez
Copy link
Contributor Author

wez commented May 9, 2018

I rebased and updated this PR. It is required in order for the GPIO pin registers to be generated correctly for atsamd21.

nsabovic and others added 3 commits August 22, 2018 16:56
This is a very basic first cut at expanding registers with derivedFrom.

This commit requires rust-embedded/svd#50
@wez wez force-pushed the register-derived-from branch from e1dddc5 to cb134d2 Compare August 22, 2018 23:56
Copy link

@ryankurte ryankurte left a 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" }

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(cc. @Emilgardis)

Copy link
Contributor Author

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.

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.

Copy link
Contributor Author

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.

@Emilgardis Emilgardis mentioned this pull request Aug 27, 2018
7 tasks
@mathk mathk added the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. label Feb 22, 2019
@mathk
Copy link

mathk commented Feb 22, 2019

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.

@japaric
Copy link
Member

japaric commented Feb 23, 2019

@mathk yes, svd-parser v0.7.0 was released last month. There have been no new commits since that release.

@mathk mathk added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Feb 25, 2019
@mathk
Copy link

mathk commented Feb 25, 2019

@wez You can bump the svd-parse version and see if that suite you

@ryankurte ryankurte self-assigned this Mar 17, 2019
@wez
Copy link
Contributor Author

wez commented Mar 23, 2019

I believe that this is obsoleted by the more current #256

@ryankurte
Copy link

Ahh, I was thinking concentric PRs rather than a PR including previous commits, thanks for pointing that out!

@wez
Copy link
Contributor Author

wez commented Jun 29, 2019

#256 is the successor to this, so closing this one out

@wez wez closed this Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants