diff options
| author | Dániel Buga <[email protected]> | 2023-06-25 23:03:14 +0200 |
|---|---|---|
| committer | Dániel Buga <[email protected]> | 2023-06-25 23:10:59 +0200 |
| commit | 12872ce49b3945c1a28ae362f78bcfb334a9eeb8 (patch) | |
| tree | 2f39d018c2bb6e3acff1c9711f65aa2c68578048 /examples/nrf52840 | |
| parent | 2809e926cf8a3a1556c674a7b17c8db4b926f243 (diff) | |
Modify an example
Diffstat (limited to 'examples/nrf52840')
| -rw-r--r-- | examples/nrf52840/src/bin/self_spawn.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/nrf52840/src/bin/self_spawn.rs b/examples/nrf52840/src/bin/self_spawn.rs index 196255a52..31ea6c81e 100644 --- a/examples/nrf52840/src/bin/self_spawn.rs +++ b/examples/nrf52840/src/bin/self_spawn.rs | |||
| @@ -7,7 +7,11 @@ use embassy_executor::Spawner; | |||
| 7 | use embassy_time::{Duration, Timer}; | 7 | use embassy_time::{Duration, 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 | mod config { |
| 11 | pub const MY_TASK_POOL_SIZE: usize = 2; | ||
| 12 | } | ||
| 13 | |||
| 14 | #[embassy_executor::task(pool_size = config::MY_TASK_POOL_SIZE)] | ||
| 11 | async fn my_task(spawner: Spawner, n: u32) { | 15 | async fn my_task(spawner: Spawner, n: u32) { |
| 12 | Timer::after(Duration::from_secs(1)).await; | 16 | Timer::after(Duration::from_secs(1)).await; |
| 13 | info!("Spawning self! {}", n); | 17 | info!("Spawning self! {}", n); |
