Further work sharing config for example and removing duplicated code.
This commit is contained in:
@ -14,9 +14,6 @@ use example_common::*;
|
||||
|
||||
use cortex_m_rt::entry;
|
||||
use embassy_stm32::dac::{Channel, Dac, Value};
|
||||
use embassy_stm32::rcc;
|
||||
use embassy_stm32::time::U32Ext;
|
||||
use embassy_stm32::Config;
|
||||
|
||||
#[entry]
|
||||
fn main() -> ! {
|
||||
@ -52,16 +49,3 @@ fn to_sine_wave(v: u8) -> u8 {
|
||||
(r.sin() * 128.0 + 127.0) as u8
|
||||
}
|
||||
}
|
||||
|
||||
fn config() -> Config {
|
||||
let mut config = Config::default();
|
||||
config.rcc = rcc_config();
|
||||
config
|
||||
}
|
||||
|
||||
fn rcc_config() -> rcc::Config {
|
||||
let mut config = rcc::Config::default();
|
||||
config.sys_ck = Some(400.mhz().into());
|
||||
config.pll1.q_ck = Some(100.mhz().into());
|
||||
config
|
||||
}
|
||||
|
Reference in New Issue
Block a user