diff options
| author | Adam Greig <[email protected]> | 2023-10-15 00:57:25 +0100 |
|---|---|---|
| committer | Adam Greig <[email protected]> | 2023-10-15 01:30:12 +0100 |
| commit | 0621e957a0ddc7010d46b3ea3ddc8b9852bc8333 (patch) | |
| tree | f6caefe939109e55a73e9141c736d2f6c20f51e8 /examples/stm32f4/src/bin/pwm_complementary.rs | |
| parent | 7559f9e5834799b041d899767ef4305dcfdf0181 (diff) | |
time: Update examples, tests, and other code to use new Timer::after_x convenience methods
Diffstat (limited to 'examples/stm32f4/src/bin/pwm_complementary.rs')
| -rw-r--r-- | examples/stm32f4/src/bin/pwm_complementary.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/stm32f4/src/bin/pwm_complementary.rs b/examples/stm32f4/src/bin/pwm_complementary.rs index 83a3c7537..a8211f6e0 100644 --- a/examples/stm32f4/src/bin/pwm_complementary.rs +++ b/examples/stm32f4/src/bin/pwm_complementary.rs | |||
| @@ -9,7 +9,7 @@ use embassy_stm32::time::khz; | |||
| 9 | use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; | 9 | use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; |
| 10 | use embassy_stm32::timer::simple_pwm::PwmPin; | 10 | use embassy_stm32::timer::simple_pwm::PwmPin; |
| 11 | use embassy_stm32::timer::Channel; | 11 | use embassy_stm32::timer::Channel; |
| 12 | use embassy_time::{Duration, Timer}; | 12 | use embassy_time::Timer; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | #[embassy_executor::main] | 15 | #[embassy_executor::main] |
| @@ -42,12 +42,12 @@ async fn main(_spawner: Spawner) { | |||
| 42 | 42 | ||
| 43 | loop { | 43 | loop { |
| 44 | pwm.set_duty(Channel::Ch1, 0); | 44 | pwm.set_duty(Channel::Ch1, 0); |
| 45 | Timer::after(Duration::from_millis(300)).await; | 45 | Timer::after_millis(300).await; |
| 46 | pwm.set_duty(Channel::Ch1, max / 4); | 46 | pwm.set_duty(Channel::Ch1, max / 4); |
| 47 | Timer::after(Duration::from_millis(300)).await; | 47 | Timer::after_millis(300).await; |
| 48 | pwm.set_duty(Channel::Ch1, max / 2); | 48 | pwm.set_duty(Channel::Ch1, max / 2); |
| 49 | Timer::after(Duration::from_millis(300)).await; | 49 | Timer::after_millis(300).await; |
| 50 | pwm.set_duty(Channel::Ch1, max - 1); | 50 | pwm.set_duty(Channel::Ch1, max - 1); |
| 51 | Timer::after(Duration::from_millis(300)).await; | 51 | Timer::after_millis(300).await; |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
