summaryrefslogtreecommitdiff
path: root/examples/stm32f4/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32f4/src/bin')
-rw-r--r--examples/stm32f4/src/bin/hello.rs9
-rw-r--r--examples/stm32f4/src/bin/sdmmc.rs10
2 files changed, 6 insertions, 13 deletions
diff --git a/examples/stm32f4/src/bin/hello.rs b/examples/stm32f4/src/bin/hello.rs
index 6facb9bb..26d3555a 100644
--- a/examples/stm32f4/src/bin/hello.rs
+++ b/examples/stm32f4/src/bin/hello.rs
@@ -9,15 +9,12 @@ use embassy_stm32::time::Hertz;
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();
config.rcc.sys_ck = Some(Hertz(84_000_000));
- config
-}
+ let _p = embassy_stm32::init(config);
-#[embassy_executor::main]
-async fn main(_spawner: Spawner) -> ! {
- let _p = embassy_stm32::init(config());
loop {
info!("Hello World!");
Timer::after(Duration::from_secs(1)).await;
diff --git a/examples/stm32f4/src/bin/sdmmc.rs b/examples/stm32f4/src/bin/sdmmc.rs
index 996694f2..b8e56d2e 100644
--- a/examples/stm32f4/src/bin/sdmmc.rs
+++ b/examples/stm32f4/src/bin/sdmmc.rs
@@ -9,15 +9,11 @@ use embassy_stm32::time::mhz;
use embassy_stm32::{interrupt, Config};
use {defmt_rtt as _, panic_probe as _};
-fn config() -> Config {
- let mut config = Config::default();
- config.rcc.sys_ck = Some(mhz(48));
- config
-}
-
#[embassy_executor::main]
async fn main(_spawner: Spawner) -> ! {
- let p = embassy_stm32::init(config());
+ let mut config = Config::default();
+ config.rcc.sys_ck = Some(mhz(48));
+ let p = embassy_stm32::init(config);
info!("Hello World!");
let irq = interrupt::take!(SDIO);