diff options
| author | kalkyl <[email protected]> | 2022-12-24 03:22:51 +0100 |
|---|---|---|
| committer | kalkyl <[email protected]> | 2022-12-24 03:22:51 +0100 |
| commit | e090ab19151fbea6736d5eac0e1497ef9c36626b (patch) | |
| tree | 706ba64221eab7f8bdc8332281fb3098ef4fd1ed /examples | |
| parent | eaad0cc1dc09e604d137b3a1bdfd3438ff990621 (diff) | |
Remove lifetime, use pac fields
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/rp/src/bin/watchdog.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/rp/src/bin/watchdog.rs b/examples/rp/src/bin/watchdog.rs index 13af22a2d..ece5cfe38 100644 --- a/examples/rp/src/bin/watchdog.rs +++ b/examples/rp/src/bin/watchdog.rs | |||
| @@ -22,11 +22,11 @@ async fn main(_spawner: Spawner) { | |||
| 22 | led.set_high(); | 22 | led.set_high(); |
| 23 | Timer::after(Duration::from_secs(2)).await; | 23 | Timer::after(Duration::from_secs(2)).await; |
| 24 | 24 | ||
| 25 | // Set to watchdog to reset if it's not reloaded within 1.05 seconds, and start it | 25 | // Set to watchdog to reset if it's not fed within 1.05 seconds, and start it |
| 26 | watchdog.start(Duration::from_millis(1_050)); | 26 | watchdog.start(Duration::from_millis(1_050)); |
| 27 | info!("Started the watchdog timer"); | 27 | info!("Started the watchdog timer"); |
| 28 | 28 | ||
| 29 | // Blink once a second for 5 seconds, refreshing the watchdog timer once a second to avoid a reset | 29 | // Blink once a second for 5 seconds, feed the watchdog timer once a second to avoid a reset |
| 30 | for _ in 1..=5 { | 30 | for _ in 1..=5 { |
| 31 | led.set_low(); | 31 | led.set_low(); |
| 32 | Timer::after(Duration::from_millis(500)).await; | 32 | Timer::after(Duration::from_millis(500)).await; |
| @@ -38,7 +38,7 @@ async fn main(_spawner: Spawner) { | |||
| 38 | 38 | ||
| 39 | info!("Stopped feeding, device will reset in 1.05 seconds"); | 39 | info!("Stopped feeding, device will reset in 1.05 seconds"); |
| 40 | // Blink 10 times per second, not feeding the watchdog. | 40 | // Blink 10 times per second, not feeding the watchdog. |
| 41 | // The processor should reset in 1.05 seconds, or 5 blinks time | 41 | // The processor should reset in 1.05 seconds. |
| 42 | loop { | 42 | loop { |
| 43 | led.set_low(); | 43 | led.set_low(); |
| 44 | Timer::after(Duration::from_millis(100)).await; | 44 | Timer::after(Duration::from_millis(100)).await; |
