Be able to scrub out BDMA-centric IRQs.
Further refine distinction between DMA and BDMA interrupts in the table.
This commit is contained in:
parent
ae948415a7
commit
1254e99be1
1 changed files with 19 additions and 2 deletions
|
@ -284,6 +284,9 @@ pub fn gen(options: Options) {
|
||||||
|
|
||||||
let number_suffix_re = Regex::new("^(.*?)[0-9]*$").unwrap();
|
let number_suffix_re = Regex::new("^(.*?)[0-9]*$").unwrap();
|
||||||
|
|
||||||
|
let mut has_bdma = false;
|
||||||
|
let mut has_dma = false;
|
||||||
|
|
||||||
for (name, p) in &core.peripherals {
|
for (name, p) in &core.peripherals {
|
||||||
let captures = number_suffix_re.captures(&name).unwrap();
|
let captures = number_suffix_re.captures(&name).unwrap();
|
||||||
let root_peri_name = captures.get(1).unwrap().as_str().to_string();
|
let root_peri_name = captures.get(1).unwrap().as_str().to_string();
|
||||||
|
@ -303,6 +306,12 @@ pub fn gen(options: Options) {
|
||||||
if let Some(block) = &p.block {
|
if let Some(block) = &p.block {
|
||||||
let bi = BlockInfo::parse(block);
|
let bi = BlockInfo::parse(block);
|
||||||
|
|
||||||
|
if bi.module == "bdma" {
|
||||||
|
has_bdma = true
|
||||||
|
} else if bi.module == "dma" {
|
||||||
|
has_dma = true
|
||||||
|
}
|
||||||
|
|
||||||
peripheral_counts.insert(
|
peripheral_counts.insert(
|
||||||
bi.module.clone(),
|
bi.module.clone(),
|
||||||
peripheral_counts.get(&bi.module).map_or(1, |v| v + 1),
|
peripheral_counts.get(&bi.module).map_or(1, |v| v + 1),
|
||||||
|
@ -522,8 +531,16 @@ pub fn gen(options: Options) {
|
||||||
|
|
||||||
interrupt_table.push(vec![name.clone()]);
|
interrupt_table.push(vec![name.clone()]);
|
||||||
|
|
||||||
if name.starts_with("DMA") || name.contains("_DMA") {
|
if name.starts_with("DMA1_") || name.starts_with("DMA2_") || name.contains("_DMA") {
|
||||||
interrupt_table.push(vec!["DMA".to_string(), name.clone()]);
|
if has_dma {
|
||||||
|
interrupt_table.push(vec!["DMA".to_string(), name.clone()]);
|
||||||
|
} else if has_bdma {
|
||||||
|
interrupt_table.push(vec!["BDMA".to_string(), name.clone()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if name.starts_with("BDMA_") || name.starts_with("BDMA1_") || name.starts_with("BDMA2_") {
|
||||||
|
interrupt_table.push(vec!["BDMA".to_string(), name.clone()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if name.contains("EXTI") {
|
if name.contains("EXTI") {
|
||||||
|
|
Loading…
Reference in a new issue