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/boot/application/rp/src/bin | |
| parent | 7559f9e5834799b041d899767ef4305dcfdf0181 (diff) | |
time: Update examples, tests, and other code to use new Timer::after_x convenience methods
Diffstat (limited to 'examples/boot/application/rp/src/bin')
| -rw-r--r-- | examples/boot/application/rp/src/bin/a.rs | 4 | ||||
| -rw-r--r-- | examples/boot/application/rp/src/bin/b.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/boot/application/rp/src/bin/a.rs b/examples/boot/application/rp/src/bin/a.rs index a4602a7ed..6fd5d7f60 100644 --- a/examples/boot/application/rp/src/bin/a.rs +++ b/examples/boot/application/rp/src/bin/a.rs | |||
| @@ -41,7 +41,7 @@ async fn main(_s: Spawner) { | |||
| 41 | let mut aligned = AlignedBuffer([0; 1]); | 41 | let mut aligned = AlignedBuffer([0; 1]); |
| 42 | let mut updater = BlockingFirmwareUpdater::new(config, &mut aligned.0); | 42 | let mut updater = BlockingFirmwareUpdater::new(config, &mut aligned.0); |
| 43 | 43 | ||
| 44 | Timer::after(Duration::from_secs(5)).await; | 44 | Timer::after_secs(5).await; |
| 45 | watchdog.feed(); | 45 | watchdog.feed(); |
| 46 | led.set_high(); | 46 | led.set_high(); |
| 47 | let mut offset = 0; | 47 | let mut offset = 0; |
| @@ -61,7 +61,7 @@ async fn main(_s: Spawner) { | |||
| 61 | watchdog.feed(); | 61 | watchdog.feed(); |
| 62 | defmt::info!("firmware written, marking update"); | 62 | defmt::info!("firmware written, marking update"); |
| 63 | updater.mark_updated().unwrap(); | 63 | updater.mark_updated().unwrap(); |
| 64 | Timer::after(Duration::from_secs(2)).await; | 64 | Timer::after_secs(2).await; |
| 65 | led.set_low(); | 65 | led.set_low(); |
| 66 | defmt::info!("update marked, resetting"); | 66 | defmt::info!("update marked, resetting"); |
| 67 | cortex_m::peripheral::SCB::sys_reset(); | 67 | cortex_m::peripheral::SCB::sys_reset(); |
diff --git a/examples/boot/application/rp/src/bin/b.rs b/examples/boot/application/rp/src/bin/b.rs index 47dec329c..1eca5b4a2 100644 --- a/examples/boot/application/rp/src/bin/b.rs +++ b/examples/boot/application/rp/src/bin/b.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_rp::gpio; | 6 | use embassy_rp::gpio; |
| 7 | use embassy_time::{Duration, Timer}; | 7 | use embassy_time::Timer; |
| 8 | use gpio::{Level, Output}; | 8 | use gpio::{Level, Output}; |
| 9 | use {defmt_rtt as _, panic_reset as _}; | 9 | use {defmt_rtt as _, panic_reset as _}; |
| 10 | 10 | ||
| @@ -15,9 +15,9 @@ async fn main(_s: Spawner) { | |||
| 15 | 15 | ||
| 16 | loop { | 16 | loop { |
| 17 | led.set_high(); | 17 | led.set_high(); |
| 18 | Timer::after(Duration::from_millis(100)).await; | 18 | Timer::after_millis(100).await; |
| 19 | 19 | ||
| 20 | led.set_low(); | 20 | led.set_low(); |
| 21 | Timer::after(Duration::from_millis(100)).await; | 21 | Timer::after_millis(100).await; |
| 22 | } | 22 | } |
| 23 | } | 23 | } |
