From 12b9c4c20e3a7d7da7637c6267a440b09f02e4ae Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Tue, 6 Sep 2022 16:47:31 +0000 Subject: [PATCH] Shrink several buffers to avoid stack overflows --- boards/rp-pico-w/Cargo.toml | 2 +- boards/rp-pico-w/examples/pico_w_blinky.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/rp-pico-w/Cargo.toml b/boards/rp-pico-w/Cargo.toml index ee321ea3a..f0bb6a76c 100644 --- a/boards/rp-pico-w/Cargo.toml +++ b/boards/rp-pico-w/Cargo.toml @@ -31,7 +31,7 @@ panic-probe = { version = "0.3", features = ["print-defmt"] } cyw43 = { version = "0.1.0", git = "https://github.com/jannic-dev-forks/cyw43", branch = "stable", features=["defmt"] } embassy-executor = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", features=["integrated-timers"], rev = "1fb6bfbec943742fb25e70391278bf4a4b638772" } embassy-futures = { version = "0.1.0" } -embassy-net = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", rev = "1fb6bfbec943742fb25e70391278bf4a4b638772", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } +embassy-net = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", rev = "1fb6bfbec943742fb25e70391278bf4a4b638772", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-4"] } defmt-rtt = "0.3" [features] diff --git a/boards/rp-pico-w/examples/pico_w_blinky.rs b/boards/rp-pico-w/examples/pico_w_blinky.rs index 8a8d836a2..be0ff825b 100644 --- a/boards/rp-pico-w/examples/pico_w_blinky.rs +++ b/boards/rp-pico-w/examples/pico_w_blinky.rs @@ -76,7 +76,7 @@ fn main() -> ! { // Safety: function never returns, executor is never dropped let executor: &'static mut Executor = unsafe { forever_mut(&mut executor) }; - let task_pool: TaskPool<_, 10> = TaskPool::new(); + let task_pool: TaskPool<_, 1> = TaskPool::new(); let task_pool = unsafe { forever(&task_pool) }; let state = cyw43::State::new(); @@ -140,7 +140,7 @@ async fn run(spawner: Spawner, pins: rp_pico_w::Pins, state: &'static cyw43::Sta info!("create cyw43 driver"); let (mut control, runner) = cyw43::new(state, pwr, spi, fw).await; - let task_pool: TaskPool<_, 10> = TaskPool::new(); + let task_pool: TaskPool<_, 1> = TaskPool::new(); let task_pool = unsafe { forever(&task_pool) }; let spawn_token = task_pool.spawn(|| runner.run()); spawner.spawn(spawn_token).unwrap(); @@ -182,7 +182,7 @@ async fn run(spawner: Spawner, pins: rp_pico_w::Pins, state: &'static cyw43::Sta let stack = Stack::new(net_device, config, stack_resources, seed); let stack = unsafe { forever(&stack) }; - let task_pool: TaskPool<_, 10> = TaskPool::new(); + let task_pool: TaskPool<_, 1> = TaskPool::new(); let task_pool = unsafe { forever(&task_pool) }; let spawn_token = task_pool.spawn(|| stack.run()); spawner.spawn(spawn_token).unwrap();