diff options
Diffstat (limited to 'examples/stm32h7/src/bin/low_level_timer_api.rs')
| -rw-r--r-- | examples/stm32h7/src/bin/low_level_timer_api.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs index f2477c7a7..e759c47a8 100644 --- a/examples/stm32h7/src/bin/low_level_timer_api.rs +++ b/examples/stm32h7/src/bin/low_level_timer_api.rs | |||
| @@ -9,7 +9,7 @@ use embassy_stm32::gpio::low_level::AFType; | |||
| 9 | use embassy_stm32::gpio::Speed; | 9 | use embassy_stm32::gpio::Speed; |
| 10 | use embassy_stm32::pwm::*; | 10 | use embassy_stm32::pwm::*; |
| 11 | use embassy_stm32::time::{khz, mhz, Hertz}; | 11 | use embassy_stm32::time::{khz, mhz, Hertz}; |
| 12 | use embassy_stm32::{into_ref, Config, Peripheral, PeripheralRef, Peripherals}; | 12 | use embassy_stm32::{into_ref, Config, Peripheral, PeripheralRef}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | pub fn config() -> Config { | 15 | pub fn config() -> Config { |
| @@ -24,8 +24,9 @@ pub fn config() -> Config { | |||
| 24 | config | 24 | config |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #[embassy_executor::main(config = "config()")] | 27 | #[embassy_executor::main] |
| 28 | async fn main(_spawner: Spawner, p: Peripherals) { | 28 | async fn main(_spawner: Spawner) { |
| 29 | let p = embassy_stm32::init(config()); | ||
| 29 | info!("Hello World!"); | 30 | info!("Hello World!"); |
| 30 | 31 | ||
| 31 | let mut pwm = SimplePwm32::new(p.TIM5, p.PA0, p.PA1, p.PA2, p.PA3, khz(10)); | 32 | let mut pwm = SimplePwm32::new(p.TIM5, p.PA0, p.PA1, p.PA2, p.PA3, khz(10)); |
