diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-08-04 21:32:39 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-04 21:32:39 +0200 |
| commit | cfa1f61154193da9a12420cb9cf300b2f3d736b2 (patch) | |
| tree | 3ef781c75da9e94483e6cbdf994bf12b2dd89bb6 /examples/stm32h7/src/example_common.rs | |
| parent | cee111c8650ad15d47a1495a33370f5ec12f83ed (diff) | |
| parent | 9726f77ce13e4c31fbe9aaa7e259aa9c31b60c63 (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.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..2e26730fa 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::time::U32Ext; | ||
| 10 | use embassy_stm32::Config; | ||
| 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 | } | ||
