From f14cacbf935feb7f9019b8f22384b9bc9fd05d77 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 23 Feb 2022 19:43:00 +0100 Subject: [PATCH] stm32-metapac: change af from string to u8 --- stm32-metapac-gen/src/assets/metadata.rs | 2 +- stm32-metapac-gen/src/data.rs | 2 +- stm32-metapac-gen/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stm32-metapac-gen/src/assets/metadata.rs b/stm32-metapac-gen/src/assets/metadata.rs index 7fe49ceba..150aa5956 100644 --- a/stm32-metapac-gen/src/assets/metadata.rs +++ b/stm32-metapac-gen/src/assets/metadata.rs @@ -76,7 +76,7 @@ pub struct PeripheralRccRegister { pub struct PeripheralPin { pub pin: &'static str, pub signal: &'static str, - pub af: Option<&'static str>, + pub af: Option, } #[derive(Debug, Eq, PartialEq, Clone)] diff --git a/stm32-metapac-gen/src/data.rs b/stm32-metapac-gen/src/data.rs index 9bb4e191d..24f0bcf0d 100644 --- a/stm32-metapac-gen/src/data.rs +++ b/stm32-metapac-gen/src/data.rs @@ -87,7 +87,7 @@ pub struct PeripheralRccRegister { pub struct PeripheralPin { pub pin: String, pub signal: String, - pub af: Option, + pub af: Option, } #[derive(Debug, Eq, PartialEq, Clone, Deserialize)] diff --git a/stm32-metapac-gen/src/lib.rs b/stm32-metapac-gen/src/lib.rs index d167da49c..fc262f9c4 100644 --- a/stm32-metapac-gen/src/lib.rs +++ b/stm32-metapac-gen/src/lib.rs @@ -182,7 +182,7 @@ pub fn gen_chip( row.push(pin.pin.clone()); row.push(pin.signal.clone()); if let Some(ref af) = pin.af { - row.push(af.clone()); + row.push(format!("{}", af)); } peripheral_pins_table.push(row); }