From f4971fbb791e6d58cddf88aa8a39d6fe16c05b4c Mon Sep 17 00:00:00 2001 From: Bob McWhirter Date: Wed, 4 Aug 2021 13:39:02 -0400 Subject: Further work sharing config for example and removing duplicated code. --- examples/stm32h7/src/example_common.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'examples/stm32h7/src/example_common.rs') diff --git a/examples/stm32h7/src/example_common.rs b/examples/stm32h7/src/example_common.rs index 54d633837..25d80f654 100644 --- a/examples/stm32h7/src/example_common.rs +++ b/examples/stm32h7/src/example_common.rs @@ -6,6 +6,8 @@ use panic_probe as _; pub use defmt::*; use core::sync::atomic::{AtomicUsize, Ordering}; +use embassy_stm32::Config; +use embassy_stm32::time::U32Ext; defmt::timestamp! {"{=u64}", { static COUNT: AtomicUsize = AtomicUsize::new(0); @@ -15,3 +17,12 @@ defmt::timestamp! {"{=u64}", { n as u64 } } + +#[allow(unused)] +pub fn config() -> Config { + let mut config = Config::default(); + config.rcc.sys_ck = Some(400.mhz().into()); + config.rcc.pll1.q_ck = Some(100.mhz().into()); + config.rcc.enable_dma1 = true; + config +} -- cgit