diff options
| author | Bob McWhirter <[email protected]> | 2021-08-04 13:39:02 -0400 |
|---|---|---|
| committer | Bob McWhirter <[email protected]> | 2021-08-04 13:39:02 -0400 |
| commit | f4971fbb791e6d58cddf88aa8a39d6fe16c05b4c (patch) | |
| tree | a44e47df15285259d4c691135fdc543ac3105b20 /examples/stm32h7/src/bin/dac.rs | |
| parent | 4fe9114695ee20e2a4ef62b09fe4b11a1c488655 (diff) | |
Further work sharing config for example and removing duplicated code.
Diffstat (limited to 'examples/stm32h7/src/bin/dac.rs')
| -rw-r--r-- | examples/stm32h7/src/bin/dac.rs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/examples/stm32h7/src/bin/dac.rs b/examples/stm32h7/src/bin/dac.rs index 47e893aae..cc9e32574 100644 --- a/examples/stm32h7/src/bin/dac.rs +++ b/examples/stm32h7/src/bin/dac.rs | |||
| @@ -14,9 +14,6 @@ use example_common::*; | |||
| 14 | 14 | ||
| 15 | use cortex_m_rt::entry; | 15 | use cortex_m_rt::entry; |
| 16 | use embassy_stm32::dac::{Channel, Dac, Value}; | 16 | use embassy_stm32::dac::{Channel, Dac, Value}; |
| 17 | use embassy_stm32::rcc; | ||
| 18 | use embassy_stm32::time::U32Ext; | ||
| 19 | use embassy_stm32::Config; | ||
| 20 | 17 | ||
| 21 | #[entry] | 18 | #[entry] |
| 22 | fn main() -> ! { | 19 | fn main() -> ! { |
| @@ -52,16 +49,3 @@ fn to_sine_wave(v: u8) -> u8 { | |||
| 52 | (r.sin() * 128.0 + 127.0) as u8 | 49 | (r.sin() * 128.0 + 127.0) as u8 |
| 53 | } | 50 | } |
| 54 | } | 51 | } |
| 55 | |||
| 56 | fn config() -> Config { | ||
| 57 | let mut config = Config::default(); | ||
| 58 | config.rcc = rcc_config(); | ||
| 59 | config | ||
| 60 | } | ||
| 61 | |||
| 62 | fn rcc_config() -> rcc::Config { | ||
| 63 | let mut config = rcc::Config::default(); | ||
| 64 | config.sys_ck = Some(400.mhz().into()); | ||
| 65 | config.pll1.q_ck = Some(100.mhz().into()); | ||
| 66 | config | ||
| 67 | } | ||
