diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-08-17 18:49:55 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-08-17 22:16:46 +0200 |
| commit | fc6e1e06b305d302d1b7ad17e8ef3a9be986c358 (patch) | |
| tree | 545ad829660f6053d29a01da286d03ec3d49f5ca /examples/stm32f7/src/bin/hello.rs | |
| parent | d881f3ad9186cf3279aa1ba27093bad94035c186 (diff) | |
Remove HAL initialization from #[embassy::main] macro.
Diffstat (limited to 'examples/stm32f7/src/bin/hello.rs')
| -rw-r--r-- | examples/stm32f7/src/bin/hello.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/stm32f7/src/bin/hello.rs b/examples/stm32f7/src/bin/hello.rs index f957656ef..6facb9bb7 100644 --- a/examples/stm32f7/src/bin/hello.rs +++ b/examples/stm32f7/src/bin/hello.rs | |||
| @@ -6,7 +6,7 @@ use defmt::info; | |||
| 6 | use embassy_executor::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_executor::time::{Duration, Timer}; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::{Config, Peripherals}; | 9 | use embassy_stm32::Config; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | fn config() -> Config { | 12 | fn config() -> Config { |
| @@ -15,8 +15,9 @@ fn config() -> Config { | |||
| 15 | config | 15 | config |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy_executor::main(config = "config()")] | 18 | #[embassy_executor::main] |
| 19 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { | 19 | async fn main(_spawner: Spawner) -> ! { |
| 20 | let _p = embassy_stm32::init(config()); | ||
| 20 | loop { | 21 | loop { |
| 21 | info!("Hello World!"); | 22 | info!("Hello World!"); |
| 22 | Timer::after(Duration::from_secs(1)).await; | 23 | Timer::after(Duration::from_secs(1)).await; |
