Skip to content

Commit

Permalink
Improve naming of interrupt vectors for new AVR MCUs
Browse files Browse the repository at this point in the history
Signed-off-by: trembel <silvano.cortesi@hotmail.com>
  • Loading branch information
trembel authored Nov 24, 2020
1 parent 3f0003c commit ce2ecb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/atdf/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ use crate::ElementExt;
pub fn parse(interrupt: &xmltree::Element) -> crate::Result<chip::Interrupt> {
interrupt.check_name("interrupt")?;

let name = interrupt.attr("name")?.clone();
let name = {
let inst_name = interrupt.attr("name")?;
interrupt
.attr("module-instance")
.map_or_else(|_| inst_name.clone(), |s| format!("{}_{}", s, inst_name))
};
let index = util::parse_int(interrupt.attr("index")?)?;
let description = interrupt
.attributes
Expand Down

0 comments on commit ce2ecb1

Please sign in to comment.