Modify an example
This commit is contained in:
parent
2809e926cf
commit
12872ce49b
1 changed files with 5 additions and 1 deletions
|
@ -7,7 +7,11 @@ use embassy_executor::Spawner;
|
||||||
use embassy_time::{Duration, Timer};
|
use embassy_time::{Duration, Timer};
|
||||||
use {defmt_rtt as _, panic_probe as _};
|
use {defmt_rtt as _, panic_probe as _};
|
||||||
|
|
||||||
#[embassy_executor::task(pool_size = 2)]
|
mod config {
|
||||||
|
pub const MY_TASK_POOL_SIZE: usize = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[embassy_executor::task(pool_size = config::MY_TASK_POOL_SIZE)]
|
||||||
async fn my_task(spawner: Spawner, n: u32) {
|
async fn my_task(spawner: Spawner, n: u32) {
|
||||||
Timer::after(Duration::from_secs(1)).await;
|
Timer::after(Duration::from_secs(1)).await;
|
||||||
info!("Spawning self! {}", n);
|
info!("Spawning self! {}", n);
|
||||||
|
|
Loading…
Reference in a new issue