Skip to content
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

Implement interrupts as specified in #2 #3

Merged
merged 1 commit into from
May 26, 2019
Merged

Conversation

offdroid
Copy link
Contributor

No description provided.

Copy link
Owner

@Rahix Rahix left a comment

Choose a reason for hiding this comment

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

Thanks for the implementation! There are a few things, I added comments where due. Although in general, good work! 👍

One more thing: Why are there two commits? Please squash your changes into a single commit.

src/atdf/interrupt.rs Outdated Show resolved Hide resolved
src/atdf/interrupt.rs Outdated Show resolved Hide resolved
src/atdf/interrupt.rs Outdated Show resolved Hide resolved
src/atdf/interrupt.rs Outdated Show resolved Hide resolved
src/svd/interrupt.rs Outdated Show resolved Hide resolved
src/svd/interrupt.rs Outdated Show resolved Hide resolved
src/svd/interrupt.rs Outdated Show resolved Hide resolved
src/svd/chip.rs Outdated Show resolved Hide resolved
src/atdf/interrupt.rs Outdated Show resolved Hide resolved
Copy link
Owner

@Rahix Rahix left a comment

Choose a reason for hiding this comment

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

A few more things, then I'll be happy 😃

src/svd/interrupt.rs Outdated Show resolved Hide resolved
src/svd/interrupt.rs Outdated Show resolved Hide resolved
src/svd/interrupt.rs Outdated Show resolved Hide resolved
src/svd/interrupt.rs Outdated Show resolved Hide resolved
src/svd/interrupt.rs Outdated Show resolved Hide resolved
src/atdf/chip.rs Show resolved Hide resolved
src/svd/interrupt.rs Outdated Show resolved Hide resolved
@Rahix
Copy link
Owner

Rahix commented May 25, 2019

There is one more issue: The interrupts are not sorted. You can fix this, using code like

let mut fields: Vec<_> = r.fields.values().collect();
fields.sort_by(|a, b| a.range.0.cmp(&b.range.0));
fields_el.children = fields
.into_iter()
.map(svd::field::generate)
.collect::<Result<Vec<_>, _>>()?;

@offdroid
Copy link
Contributor Author

There is one more issue: The interrupts are not sorted. You can fix this, using code like

let mut fields: Vec<_> = r.fields.values().collect();
fields.sort_by(|a, b| a.range.0.cmp(&b.range.0));
fields_el.children = fields
.into_iter()
.map(svd::field::generate)
.collect::<Result<Vec<_>, _>>()?;

Should they be sorted by index or name?

Copy link
Owner

@Rahix Rahix left a comment

Choose a reason for hiding this comment

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

Looking good! Please squash your changes, so I can merge them!

This commit makes atdf2svd parse the interrupt list
from the source file and adds all interrupts to the CPU
peripheral in the generated svd.

Fixes Rahix#2

Signed-off-by: offdroid <filip.skubacz.public@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants