From aca0fb10651359b5a3939f7424ac0a78ef20cc27 Mon Sep 17 00:00:00 2001 From: Thales Fragoso Date: Sun, 20 Jun 2021 16:46:26 -0300 Subject: net: Make the user pass in the StackResources in init By having the user pass in the resources, we can make them generic, this way the user can choose the size of the individual resources --- examples/std/src/bin/net.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples/std') diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs index 5a726e5d2..344a6e4d3 100644 --- a/examples/std/src/bin/net.rs +++ b/examples/std/src/bin/net.rs @@ -19,6 +19,7 @@ use crate::tuntap::TunTapDevice; static DEVICE: Forever = Forever::new(); static CONFIG: Forever = Forever::new(); +static NET_RESOURCES: Forever> = Forever::new(); #[derive(Clap)] #[clap(version = "1.0")] @@ -51,8 +52,10 @@ async fn main_task(spawner: Spawner) { // DHCP configruation let config = DhcpConfigurator::new(); + let net_resources = StackResources::new(); + // Init network stack - embassy_net::init(DEVICE.put(device), CONFIG.put(config)); + embassy_net::init(DEVICE.put(device), CONFIG.put(config), NET_RESOURCES.put(net_resources)); // Launch network task spawner.spawn(net_task()).unwrap(); -- cgit