diff options
Diffstat (limited to 'examples/nrf52840/src/bin/self_spawn_current_executor.rs')
| -rw-r--r-- | examples/nrf52840/src/bin/self_spawn_current_executor.rs | 4 |
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 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_time::{Duration, Timer}; | 7 | use embassy_time::Timer; |
| 8 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 9 | ||
| 10 | #[embassy_executor::task(pool_size = 2)] | 10 | #[embassy_executor::task(pool_size = 2)] |
| 11 | async fn my_task(n: u32) { | 11 | async 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 | } |
