Remove the Option around the pins Vec.
This commit is contained in:
parent
be180c1c52
commit
d4d914ea50
@ -41,7 +41,7 @@ pub struct Peripheral {
|
||||
#[serde(default)]
|
||||
pub clock: Option<String>,
|
||||
#[serde(default)]
|
||||
pub pins: Option<Vec<Pin>>,
|
||||
pub pins: Vec<Pin>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Deserialize)]
|
||||
@ -52,11 +52,12 @@ pub struct Pin {
|
||||
}
|
||||
|
||||
struct BlockInfo {
|
||||
/// usart_v1/USART -> usart
|
||||
module: String,
|
||||
// usart_v1/USART -> usart
|
||||
/// usart_v1/USART -> v1
|
||||
version: String,
|
||||
// usart_v1/USART -> v1
|
||||
block: String, // usart_v1/USART -> USART
|
||||
/// usart_v1/USART -> USART
|
||||
block: String,
|
||||
}
|
||||
|
||||
impl BlockInfo {
|
||||
@ -161,8 +162,7 @@ fn main() {
|
||||
if let Some(block) = &p.block {
|
||||
let bi = BlockInfo::parse(block);
|
||||
|
||||
if let Some(pins) = &p.pins {
|
||||
for pin in pins {
|
||||
for pin in &p.pins {
|
||||
let mut row = Vec::new();
|
||||
row.push(name.clone());
|
||||
row.push(bi.module.clone());
|
||||
@ -174,7 +174,6 @@ fn main() {
|
||||
}
|
||||
peripheral_pins_table.push(row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cfgs.insert(bi.module.clone());
|
||||
|
Loading…
x
Reference in New Issue
Block a user