diff options
Diffstat (limited to 'examples/nrf/src/bin/self_spawn_current_executor.rs')
| -rw-r--r-- | examples/nrf/src/bin/self_spawn_current_executor.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/nrf/src/bin/self_spawn_current_executor.rs b/examples/nrf/src/bin/self_spawn_current_executor.rs index 3c3379ce6..1d8309d77 100644 --- a/examples/nrf/src/bin/self_spawn_current_executor.rs +++ b/examples/nrf/src/bin/self_spawn_current_executor.rs | |||
| @@ -3,19 +3,19 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::time::{Duration, Timer}; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy_nrf::Peripherals; | 8 | use embassy_nrf::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::task(pool_size = 2)] | 11 | #[embassy_executor::task(pool_size = 2)] |
| 12 | async fn my_task(n: u32) { | 12 | async fn my_task(n: u32) { |
| 13 | Timer::after(Duration::from_secs(1)).await; | 13 | Timer::after(Duration::from_secs(1)).await; |
| 14 | info!("Spawning self! {}", n); | 14 | info!("Spawning self! {}", n); |
| 15 | unwrap!(Spawner::for_current_executor().await.spawn(my_task(n + 1))); | 15 | unwrap!(Spawner::for_current_executor().await.spawn(my_task(n + 1))); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main] | 18 | #[embassy_executor::main] |
| 19 | async fn main(spawner: Spawner, _p: Peripherals) { | 19 | async fn main(spawner: Spawner, _p: Peripherals) { |
| 20 | info!("Hello World!"); | 20 | info!("Hello World!"); |
| 21 | unwrap!(spawner.spawn(my_task(0))); | 21 | unwrap!(spawner.spawn(my_task(0))); |
