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:
@ -34,17 +34,13 @@ async fn net_task(stack: &'static Stack<Device>) -> ! {
|
||||
stack.run().await
|
||||
}
|
||||
|
||||
pub fn config() -> Config {
|
||||
#[embassy_executor::main]
|
||||
async fn main(spawner: Spawner) -> ! {
|
||||
let mut config = Config::default();
|
||||
config.rcc.sys_ck = Some(mhz(400));
|
||||
config.rcc.hclk = Some(mhz(200));
|
||||
config.rcc.pll1.q_ck = Some(mhz(100));
|
||||
config
|
||||
}
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(spawner: Spawner) -> ! {
|
||||
let p = embassy_stm32::init(config());
|
||||
let p = embassy_stm32::init(config);
|
||||
info!("Hello World!");
|
||||
|
||||
// Generate random seed.
|
||||
|
Reference in New Issue
Block a user