aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf/src/bin/self_spawn_current_executor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nrf/src/bin/self_spawn_current_executor.rs')
-rw-r--r--examples/nrf/src/bin/self_spawn_current_executor.rs8
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
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::task(pool_size = 2)] 11#[embassy_executor::task(pool_size = 2)]
12async fn my_task(n: u32) { 12async 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]
19async fn main(spawner: Spawner, _p: Peripherals) { 19async 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)));