File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff 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 {}: {:?}" ,
You can’t perform that action at this time.
0 commit comments