Skip to content

Commit 667b266

Browse files
committed
add exeption for LTDC_LO
1 parent e5951d9 commit 667b266

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

stm32-data-gen/src/interrupts.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,19 @@ impl ChipInterrupts {
379379
if irqs.len() != 1 && signal != "GLOBAL" {
380380
irqs.retain(|irq| irq != &p.name);
381381
}
382-
382+
383+
// Special case for LTDC LO signal with both LTDC_LO and LTDC_LO_ERR IRQs
384+
if irqs.len() != 1 && p.name == "LTDC" && signal == "LO" {
385+
// Prefer the IRQ name that doesn't contain "_ERR"
386+
let non_err_irqs: Vec<_> = irqs.iter().filter(|x| !x.contains("_ERR")).cloned().collect();
387+
if !non_err_irqs.is_empty() {
388+
// If we have non-error IRQs, keep only the first one
389+
let preferred_irq = non_err_irqs[0].clone();
390+
irqs.clear();
391+
irqs.insert(preferred_irq);
392+
}
393+
}
394+
383395
if irqs.len() != 1 {
384396
panic!(
385397
"dup irqs on chip {:?} nvic {:?} peri {} signal {}: {:?}",

0 commit comments

Comments
 (0)