diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-06-25 21:17:56 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-06-25 21:17:56 +0000 |
| commit | d8c70c5c3e89a0a83ae58881fe0bed5071939b2e (patch) | |
| tree | 2f39d018c2bb6e3acff1c9711f65aa2c68578048 /examples | |
| parent | 03e0116a56d7bc4b8eb639fd590eaa186d039b2b (diff) | |
| parent | 12872ce49b3945c1a28ae362f78bcfb334a9eeb8 (diff) | |
Merge pull request #1583 from bugadani/const
Allow path expressions as `task(pool_size)`
Diffstat (limited to 'examples')
| -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); |
