aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/example_common.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-08-04 21:32:39 +0200
committerGitHub <[email protected]>2021-08-04 21:32:39 +0200
commitcfa1f61154193da9a12420cb9cf300b2f3d736b2 (patch)
tree3ef781c75da9e94483e6cbdf994bf12b2dd89bb6 /examples/stm32h7/src/example_common.rs
parentcee111c8650ad15d47a1495a33370f5ec12f83ed (diff)
parent9726f77ce13e4c31fbe9aaa7e259aa9c31b60c63 (diff)
Merge pull request #344 from bobmcwhirter/remove_builders
Remove builders from Config(s) and examples.
Diffstat (limited to 'examples/stm32h7/src/example_common.rs')
-rw-r--r--examples/stm32h7/src/example_common.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/stm32h7/src/example_common.rs b/examples/stm32h7/src/example_common.rs
index 54d633837..2e26730fa 100644
--- a/examples/stm32h7/src/example_common.rs
+++ b/examples/stm32h7/src/example_common.rs
@@ -6,6 +6,8 @@ use panic_probe as _;
6pub use defmt::*; 6pub use defmt::*;
7 7
8use core::sync::atomic::{AtomicUsize, Ordering}; 8use core::sync::atomic::{AtomicUsize, Ordering};
9use embassy_stm32::time::U32Ext;
10use embassy_stm32::Config;
9 11
10defmt::timestamp! {"{=u64}", { 12defmt::timestamp! {"{=u64}", {
11 static COUNT: AtomicUsize = AtomicUsize::new(0); 13 static COUNT: AtomicUsize = AtomicUsize::new(0);
@@ -15,3 +17,12 @@ defmt::timestamp! {"{=u64}", {
15 n as u64 17 n as u64
16 } 18 }
17} 19}
20
21#[allow(unused)]
22pub fn config() -> Config {
23 let mut config = Config::default();
24 config.rcc.sys_ck = Some(400.mhz().into());
25 config.rcc.pll1.q_ck = Some(100.mhz().into());
26 config.rcc.enable_dma1 = true;
27 config
28}