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:
@@ -11,7 +11,8 @@ use embassy_stm32::time::{khz, mhz};
|
||||
use embassy_stm32::Config;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
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(400));
|
||||
@@ -20,12 +21,7 @@ pub fn config() -> Config {
|
||||
config.rcc.pclk2 = Some(mhz(100));
|
||||
config.rcc.pclk3 = Some(mhz(100));
|
||||
config.rcc.pclk4 = 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!");
|
||||
|
||||
let ch1 = PwmPin::new_ch1(p.PA6);
|
||||
|
||||
Reference in New Issue
Block a user