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/nrf52840/src/bin/pwm_double_sequence.rs | |
| parent | 7559f9e5834799b041d899767ef4305dcfdf0181 (diff) | |
time: Update examples, tests, and other code to use new Timer::after_x convenience methods
Diffstat (limited to 'examples/nrf52840/src/bin/pwm_double_sequence.rs')
| -rw-r--r-- | examples/nrf52840/src/bin/pwm_double_sequence.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/nrf52840/src/bin/pwm_double_sequence.rs b/examples/nrf52840/src/bin/pwm_double_sequence.rs index 16e50e909..1bfe6e15a 100644 --- a/examples/nrf52840/src/bin/pwm_double_sequence.rs +++ b/examples/nrf52840/src/bin/pwm_double_sequence.rs | |||
| @@ -7,7 +7,7 @@ use embassy_executor::Spawner; | |||
| 7 | use embassy_nrf::pwm::{ | 7 | use embassy_nrf::pwm::{ |
| 8 | Config, Prescaler, Sequence, SequenceConfig, SequenceMode, SequencePwm, Sequencer, StartSequence, | 8 | Config, Prescaler, Sequence, SequenceConfig, SequenceMode, SequencePwm, Sequencer, StartSequence, |
| 9 | }; | 9 | }; |
| 10 | use embassy_time::{Duration, Timer}; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy_executor::main] | 13 | #[embassy_executor::main] |
| @@ -36,6 +36,6 @@ async fn main(_spawner: Spawner) { | |||
| 36 | // we can abort a sequence if we need to before its complete with pwm.stop() | 36 | // we can abort a sequence if we need to before its complete with pwm.stop() |
| 37 | // or stop is also implicitly called when the pwm peripheral is dropped | 37 | // or stop is also implicitly called when the pwm peripheral is dropped |
| 38 | // when it goes out of scope | 38 | // when it goes out of scope |
| 39 | Timer::after(Duration::from_millis(40000)).await; | 39 | Timer::after_millis(40000).await; |
| 40 | info!("pwm stopped early!"); | 40 | info!("pwm stopped early!"); |
| 41 | } | 41 | } |
