Add NVIC_PRIO_BITS to data and metapac
This commit is contained in:
parent
e208ba72b6
commit
9c8ef4b931
@ -691,6 +691,10 @@ fn process_core(
|
|||||||
want_nvic_name
|
want_nvic_name
|
||||||
};
|
};
|
||||||
let chip_nvic = group.ips.values().find(|x| x.name == want_nvic_name).unwrap();
|
let chip_nvic = group.ips.values().find(|x| x.name == want_nvic_name).unwrap();
|
||||||
|
|
||||||
|
// With the current data sources, this value is always either 2 or 4, and never unwraps to None(0)
|
||||||
|
let nvic_priority_bits = *(defines.0.get("__NVIC_PRIO_BITS").unwrap_or(&0)) as u8;
|
||||||
|
|
||||||
let mut header_irqs = h.interrupts.get(core_name).unwrap().clone();
|
let mut header_irqs = h.interrupts.get(core_name).unwrap().clone();
|
||||||
let chip_irqs = chip_interrupts
|
let chip_irqs = chip_interrupts
|
||||||
.0
|
.0
|
||||||
@ -963,6 +967,7 @@ fn process_core(
|
|||||||
stm32_data_serde::chip::Core {
|
stm32_data_serde::chip::Core {
|
||||||
name: real_core_name.clone(),
|
name: real_core_name.clone(),
|
||||||
peripherals,
|
peripherals,
|
||||||
|
nvic_priority_bits,
|
||||||
interrupts,
|
interrupts,
|
||||||
dma_channels: core_dma_channels,
|
dma_channels: core_dma_channels,
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ pub mod chip {
|
|||||||
pub struct Core {
|
pub struct Core {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub peripherals: Vec<core::Peripheral>,
|
pub peripherals: Vec<core::Peripheral>,
|
||||||
|
pub nvic_priority_bits: u8,
|
||||||
pub interrupts: Vec<core::Interrupt>,
|
pub interrupts: Vec<core::Interrupt>,
|
||||||
pub dma_channels: Vec<core::DmaChannels>,
|
pub dma_channels: Vec<core::DmaChannels>,
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "stm32-metapac"
|
name = "stm32-metapac"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
repository = "https://github.com/embassy-rs/stm32-data"
|
repository = "https://github.com/embassy-rs/stm32-data"
|
||||||
|
@ -5,6 +5,7 @@ pub struct Metadata {
|
|||||||
pub line: &'static str,
|
pub line: &'static str,
|
||||||
pub memory: &'static [MemoryRegion],
|
pub memory: &'static [MemoryRegion],
|
||||||
pub peripherals: &'static [Peripheral],
|
pub peripherals: &'static [Peripheral],
|
||||||
|
pub nvic_priority_bits: u8,
|
||||||
pub interrupts: &'static [Interrupt],
|
pub interrupts: &'static [Interrupt],
|
||||||
pub dma_channels: &'static [DmaChannel],
|
pub dma_channels: &'static [DmaChannel],
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ pub enum MemoryRegionKind {
|
|||||||
pub struct Core {
|
pub struct Core {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub peripherals: Vec<Peripheral>,
|
pub peripherals: Vec<Peripheral>,
|
||||||
|
pub nvic_priority_bits: u8,
|
||||||
pub interrupts: Vec<Interrupt>,
|
pub interrupts: Vec<Interrupt>,
|
||||||
pub dma_channels: Vec<DmaChannel>,
|
pub dma_channels: Vec<DmaChannel>,
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ impl Gen {
|
|||||||
let mut ir = ir::IR::new();
|
let mut ir = ir::IR::new();
|
||||||
|
|
||||||
let mut dev = ir::Device {
|
let mut dev = ir::Device {
|
||||||
|
nvic_priority_bits: core.nvic_priority_bits,
|
||||||
interrupts: Vec::new(),
|
interrupts: Vec::new(),
|
||||||
peripherals: Vec::new(),
|
peripherals: Vec::new(),
|
||||||
};
|
};
|
||||||
@ -194,6 +195,7 @@ impl Gen {
|
|||||||
line: {:?},
|
line: {:?},
|
||||||
memory: {},
|
memory: {},
|
||||||
peripherals: PERIPHERALS,
|
peripherals: PERIPHERALS,
|
||||||
|
nvic_priority_bits: {},
|
||||||
interrupts: INTERRUPTS,
|
interrupts: INTERRUPTS,
|
||||||
dma_channels: DMA_CHANNELS,
|
dma_channels: DMA_CHANNELS,
|
||||||
}};",
|
}};",
|
||||||
@ -202,6 +204,7 @@ impl Gen {
|
|||||||
&chip.family,
|
&chip.family,
|
||||||
&chip.line,
|
&chip.line,
|
||||||
stringify(&chip.memory),
|
stringify(&chip.memory),
|
||||||
|
&core.nvic_priority_bits,
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut file = File::create(chip_dir.join("metadata.rs")).unwrap();
|
let mut file = File::create(chip_dir.join("metadata.rs")).unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user