aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf52840/src/bin/self_spawn_current_executor.rs
diff options
context:
space:
mode:
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}