Modify an example

This commit is contained in:
Dániel Buga 2023-06-25 23:03:14 +02:00
parent 2809e926cf
commit 12872ce49b

View File

@ -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);