Further work sharing config for example and removing duplicated code.

This commit is contained in:
Bob McWhirter
2021-08-04 13:39:02 -04:00
parent 4fe9114695
commit f4971fbb79
6 changed files with 25 additions and 73 deletions

View File

@@ -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
}