aboutsummaryrefslogtreecommitdiff
path: root/examples/std/src/bin
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-06-21 01:49:32 +0200
committerGitHub <[email protected]>2021-06-21 01:49:32 +0200
commit9e5406f761a5a71e8a634796a60f1148b7d96ec1 (patch)
tree45dcecda6c8e6cd65502b37ddfccb4b8736362c6 /examples/std/src/bin
parent5a4e3ceb884f0b2d9baaa57ada61bbf30cd4c208 (diff)
parentaca0fb10651359b5a3939f7424ac0a78ef20cc27 (diff)
Merge pull request #252 from thalesfragoso/net-resources
net: Make the user pass in the StackResources in init
Diffstat (limited to 'examples/std/src/bin')
-rw-r--r--examples/std/src/bin/net.rs5
1 files changed, 4 insertions, 1 deletions
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;
19 19
20static DEVICE: Forever<TunTapDevice> = Forever::new(); 20static DEVICE: Forever<TunTapDevice> = Forever::new();
21static CONFIG: Forever<DhcpConfigurator> = Forever::new(); 21static CONFIG: Forever<DhcpConfigurator> = Forever::new();
22static NET_RESOURCES: Forever<StackResources<1, 2, 8>> = Forever::new();
22 23
23#[derive(Clap)] 24#[derive(Clap)]
24#[clap(version = "1.0")] 25#[clap(version = "1.0")]
@@ -51,8 +52,10 @@ async fn main_task(spawner: Spawner) {
51 // DHCP configruation 52 // DHCP configruation
52 let config = DhcpConfigurator::new(); 53 let config = DhcpConfigurator::new();
53 54
55 let net_resources = StackResources::new();
56
54 // Init network stack 57 // Init network stack
55 embassy_net::init(DEVICE.put(device), CONFIG.put(config)); 58 embassy_net::init(DEVICE.put(device), CONFIG.put(config), NET_RESOURCES.put(net_resources));
56 59
57 // Launch network task 60 // Launch network task
58 spawner.spawn(net_task()).unwrap(); 61 spawner.spawn(net_task()).unwrap();