Skip to content

Commit 354d225

Browse files
committed
rearange peri special cases
1 parent 6867fec commit 354d225

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

stm32-data-gen/src/interrupts.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -379,16 +379,6 @@ impl ChipInterrupts {
379379
for (signal, irqs) in signals {
380380
let mut irqs = irqs.clone();
381381

382-
// If there's a duplicate irqs in a signal other than "global", keep the non-global one.
383-
if irqs.len() != 1 && signal != "GLOBAL" {
384-
irqs.retain(|irq| !globals.contains(irq));
385-
}
386-
387-
// If there's still duplicate irqs, keep the one that doesn't match the peri name.
388-
if irqs.len() != 1 && signal != "GLOBAL" {
389-
irqs.retain(|irq| irq != &p.name);
390-
}
391-
392382
// Special case for LTDC LO signal with both LTDC_LO and LTDC_LO_ERR IRQs
393383
if irqs.len() != 1 && p.name == "LTDC" && signal == "LO" {
394384
// Prefer the IRQ name that doesn't contain "_ERR"
@@ -401,6 +391,16 @@ impl ChipInterrupts {
401391
}
402392
}
403393

394+
// If there's a duplicate irqs in a signal other than "global", keep the non-global one.
395+
if irqs.len() != 1 && signal != "GLOBAL" {
396+
irqs.retain(|irq| !globals.contains(irq));
397+
}
398+
399+
// If there's still duplicate irqs, keep the one that doesn't match the peri name.
400+
if irqs.len() != 1 && signal != "GLOBAL" {
401+
irqs.retain(|irq| irq != &p.name);
402+
}
403+
404404
if irqs.len() != 1 {
405405
panic!(
406406
"dup irqs on chip {:?} nvic {:?} peri {} signal {}: {:?}",

0 commit comments

Comments
 (0)