Skip to content

Commit ca5ed59

Browse files
committed
fix adding not existing USB signals
1 parent 354d225 commit ca5ed59

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

stm32-data-gen/src/interrupts.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,9 @@ impl ChipInterrupts {
429429
fn tokenize_name(name: &str) -> Vec<String> {
430430
// Treat IRQ names are "tokens" separated by `_`, except some tokens
431431
// contain `_` themselves, such as `C1_RX`.
432-
let r =
433-
regex!(r"(SPDIF_RX|EP\d+_(IN|OUT)|OTG_FS|OTG_HS|USB_DRD_FS|USB_FS|C1_RX|C1_TX|C2_RX|C2_TX|[A-Z0-9]+(_\d+)*)_*");
432+
let r = regex!(
433+
r"(SPDIF_RX|EP\d+_(IN|OUT)|OTG_FS|OTG_HS|USB1_OTG_HS|USB2_OTG_HS|USB_DRD_FS|USB_FS|C1_RX|C1_TX|C2_RX|C2_TX|[A-Z0-9]+(_\d+)*)_*"
434+
);
434435
let name = name.to_ascii_uppercase();
435436

436437
r.captures_iter(&name)
@@ -446,6 +447,8 @@ fn match_peris(peris: &[String], name: &str) -> Vec<String> {
446447
("OTG_FS", &["USB_OTG_FS"]),
447448
("USB", &["USB_DRD_FS"]),
448449
("USB_DRD_FS", &["USB"]),
450+
("USB1_OTG_HS", &["USB1_OTG_HS"]),
451+
("USB2_OTG_HS", &["USB2_OTG_HS"]), // Add this entry to handle USB2_OTG_HS
449452
("UCPD1_2", &["UCPD1", "UCPD2"]),
450453
("ADC1", &["ADC"]),
451454
("CEC", &["HDMI_CEC"]),
@@ -524,7 +527,9 @@ fn valid_signals(peri: &str) -> Vec<String> {
524527
("WWDG", &["GLOBAL", "RST"]),
525528
("USB_OTG_FS", &["GLOBAL", "EP1_OUT", "EP1_IN", "WKUP"]),
526529
("USB_OTG_HS", &["GLOBAL", "EP1_OUT", "EP1_IN", "WKUP"]),
527-
("USB", &["LP", "HP", "WKUP", "USB1", "USB2", "OTG_HS"]),
530+
("USB1_OTG_HS", &["GLOBAL", "EP1_OUT", "EP1_IN", "WKUP"]),
531+
("USB2_OTG_HS", &["GLOBAL", "EP1_OUT", "EP1_IN", "WKUP"]),
532+
("USB", &["LP", "HP", "WKUP", "OTG_HS"]),
528533
("GPU2D", &["ER"]),
529534
("SAI", &["A", "B"]),
530535
("ADF", &["FLT0"]),

0 commit comments

Comments
 (0)