examples Remove the fn config()
idiom.
It was only useful for doing #[embassy_executor::main(config = "config()")]`. Now that it's gone, it makes more sense to build the config in main directly.
This commit is contained in:
@ -9,7 +9,8 @@ use embassy_stm32::rng::Rng;
|
||||
use embassy_stm32::Config;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
fn config() -> Config {
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let mut config = Config::default();
|
||||
// 72Mhz clock (16 / 1 * 18 / 4)
|
||||
config.rcc.mux = ClockSrc::PLL(
|
||||
@ -19,12 +20,8 @@ fn config() -> Config {
|
||||
PLLMul::Mul18,
|
||||
Some(PLLClkDiv::Div6), // 48Mhz (16 / 1 * 18 / 6)
|
||||
);
|
||||
config
|
||||
}
|
||||
let p = embassy_stm32::init(config);
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_stm32::init(config());
|
||||
info!("Hello World!");
|
||||
|
||||
let mut rng = Rng::new(p.RNG);
|
||||
|
Reference in New Issue
Block a user