diff options
Diffstat (limited to 'examples/stm32f2/src/bin')
| -rw-r--r-- | examples/stm32f2/src/bin/blinky.rs | 4 | ||||
| -rw-r--r-- | examples/stm32f2/src/bin/pll.rs | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/examples/stm32f2/src/bin/blinky.rs b/examples/stm32f2/src/bin/blinky.rs index 48ae2e711..2afdeeb35 100644 --- a/examples/stm32f2/src/bin/blinky.rs +++ b/examples/stm32f2/src/bin/blinky.rs | |||
| @@ -6,11 +6,11 @@ use defmt::*; | |||
| 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::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 10 | ||
| 12 | #[embassy_executor::main] | 11 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 12 | async fn main(_spawner: Spawner) { |
| 13 | let p = embassy_stm32::init(Default::default()); | ||
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
| 16 | let mut led = Output::new(p.PB14, Level::High, Speed::Low); | 16 | let mut led = Output::new(p.PB14, Level::High, Speed::Low); |
diff --git a/examples/stm32f2/src/bin/pll.rs b/examples/stm32f2/src/bin/pll.rs index 01e63b15e..bc0c160ba 100644 --- a/examples/stm32f2/src/bin/pll.rs +++ b/examples/stm32f2/src/bin/pll.rs | |||
| @@ -11,7 +11,7 @@ use embassy_stm32::rcc::{ | |||
| 11 | APBPrescaler, ClockSrc, HSEConfig, HSESrc, PLL48Div, PLLConfig, PLLMainDiv, PLLMul, PLLPreDiv, PLLSrc, | 11 | APBPrescaler, ClockSrc, HSEConfig, HSESrc, PLL48Div, PLLConfig, PLLMainDiv, PLLMul, PLLPreDiv, PLLSrc, |
| 12 | }; | 12 | }; |
| 13 | use embassy_stm32::time::Hertz; | 13 | use embassy_stm32::time::Hertz; |
| 14 | use embassy_stm32::{Config, Peripherals}; | 14 | use embassy_stm32::Config; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | 16 | ||
| 17 | // Example config for maximum performance on a NUCLEO-F207ZG board | 17 | // Example config for maximum performance on a NUCLEO-F207ZG board |
| @@ -43,8 +43,9 @@ fn config() -> Config { | |||
| 43 | config | 43 | config |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | #[embassy_executor::main(config = "config()")] | 46 | #[embassy_executor::main] |
| 47 | async fn main(_spawner: Spawner, _p: Peripherals) { | 47 | async fn main(_spawner: Spawner) { |
| 48 | let _p = embassy_stm32::init(config()); | ||
| 48 | loop { | 49 | loop { |
| 49 | Timer::after(Duration::from_millis(1000)).await; | 50 | Timer::after(Duration::from_millis(1000)).await; |
| 50 | info!("1s elapsed"); | 51 | info!("1s elapsed"); |
