Simplify construction of StackResources::new()

This commit is contained in:
Martin Liska
2024-08-08 10:53:55 +02:00
parent 891c5ee105
commit 961ec387ed
5 changed files with 5 additions and 15 deletions

View File

@@ -101,12 +101,7 @@ async fn main(spawner: Spawner) {
// Init network stack
static STACK: StaticCell<Stack<Device>> = StaticCell::new();
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
let stack = &*STACK.init(Stack::new(
device,
config,
RESOURCES.init(StackResources::<2>::new()),
seed,
));
let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed));
// Launch network task
unwrap!(spawner.spawn(net_task(&stack)));