aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf52840/src/bin/self_spawn_current_executor.rs
diff options
context:
space:
mode:
authorAdam Greig <[email protected]>2023-10-15 00:57:25 +0100
committerAdam Greig <[email protected]>2023-10-15 01:30:12 +0100
commit0621e957a0ddc7010d46b3ea3ddc8b9852bc8333 (patch)
treef6caefe939109e55a73e9141c736d2f6c20f51e8 /examples/nrf52840/src/bin/self_spawn_current_executor.rs
parent7559f9e5834799b041d899767ef4305dcfdf0181 (diff)
time: Update examples, tests, and other code to use new Timer::after_x convenience methods
Diffstat (limited to 'examples/nrf52840/src/bin/self_spawn_current_executor.rs')
-rw-r--r--examples/nrf52840/src/bin/self_spawn_current_executor.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/nrf52840/src/bin/self_spawn_current_executor.rs b/examples/nrf52840/src/bin/self_spawn_current_executor.rs
index 8a179886c..65d50f8c3 100644
--- a/examples/nrf52840/src/bin/self_spawn_current_executor.rs
+++ b/examples/nrf52840/src/bin/self_spawn_current_executor.rs
@@ -4,12 +4,12 @@
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy_executor::Spawner; 6use embassy_executor::Spawner;
7use embassy_time::{Duration, Timer}; 7use embassy_time::Timer;
8use {defmt_rtt as _, panic_probe as _}; 8use {defmt_rtt as _, panic_probe as _};
9 9
10#[embassy_executor::task(pool_size = 2)] 10#[embassy_executor::task(pool_size = 2)]
11async fn my_task(n: u32) { 11async fn my_task(n: u32) {
12 Timer::after(Duration::from_secs(1)).await; 12 Timer::after_secs(1).await;
13 info!("Spawning self! {}", n); 13 info!("Spawning self! {}", n);
14 unwrap!(Spawner::for_current_executor().await.spawn(my_task(n + 1))); 14 unwrap!(Spawner::for_current_executor().await.spawn(my_task(n + 1)));
15} 15}