diff options
Diffstat (limited to 'examples/stm32h7/src/example_common.rs')
| -rw-r--r-- | examples/stm32h7/src/example_common.rs | 11 |
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..25d80f654 100644 --- a/examples/stm32h7/src/example_common.rs +++ b/examples/stm32h7/src/example_common.rs | |||
| @@ -6,6 +6,8 @@ use panic_probe as _; | |||
| 6 | pub use defmt::*; | 6 | pub use defmt::*; |
| 7 | 7 | ||
| 8 | use core::sync::atomic::{AtomicUsize, Ordering}; | 8 | use core::sync::atomic::{AtomicUsize, Ordering}; |
| 9 | use embassy_stm32::Config; | ||
| 10 | use embassy_stm32::time::U32Ext; | ||
| 9 | 11 | ||
| 10 | defmt::timestamp! {"{=u64}", { | 12 | defmt::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)] | ||
| 22 | pub 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 | } | ||
