diff options
Diffstat (limited to 'examples')
26 files changed, 41 insertions, 126 deletions
diff --git a/examples/nrf52840/src/bin/ethernet_enc28j60.rs b/examples/nrf52840/src/bin/ethernet_enc28j60.rs index 279f32edc..94cf09c88 100644 --- a/examples/nrf52840/src/bin/ethernet_enc28j60.rs +++ b/examples/nrf52840/src/bin/ethernet_enc28j60.rs | |||
| @@ -66,16 +66,11 @@ async fn main(spawner: Spawner) { | |||
| 66 | let seed = u64::from_le_bytes(seed); | 66 | let seed = u64::from_le_bytes(seed); |
| 67 | 67 | ||
| 68 | // Init network stack | 68 | // Init network stack |
| 69 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 69 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 70 | static STACK: StaticCell< | 70 | static STACK: StaticCell< |
| 71 | Stack<Enc28j60<ExclusiveDevice<Spim<'static, peripherals::SPI3>, Output<'static>, Delay>, Output<'static>>>, | 71 | Stack<Enc28j60<ExclusiveDevice<Spim<'static, peripherals::SPI3>, Output<'static>, Delay>, Output<'static>>>, |
| 72 | > = StaticCell::new(); | 72 | > = StaticCell::new(); |
| 73 | let stack = STACK.init(Stack::new( | 73 | let stack = STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 74 | device, | ||
| 75 | config, | ||
| 76 | RESOURCES.init(StackResources::<2>::new()), | ||
| 77 | seed, | ||
| 78 | )); | ||
| 79 | 74 | ||
| 80 | unwrap!(spawner.spawn(net_task(stack))); | 75 | unwrap!(spawner.spawn(net_task(stack))); |
| 81 | 76 | ||
diff --git a/examples/nrf52840/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs index a7e5c2668..e56b215e3 100644 --- a/examples/nrf52840/src/bin/usb_ethernet.rs +++ b/examples/nrf52840/src/bin/usb_ethernet.rs | |||
| @@ -115,7 +115,7 @@ async fn main(spawner: Spawner) { | |||
| 115 | let seed = u64::from_le_bytes(seed); | 115 | let seed = u64::from_le_bytes(seed); |
| 116 | 116 | ||
| 117 | // Init network stack | 117 | // Init network stack |
| 118 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 118 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 119 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); | 119 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); |
| 120 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); | 120 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 121 | 121 | ||
diff --git a/examples/nrf52840/src/bin/wifi_esp_hosted.rs b/examples/nrf52840/src/bin/wifi_esp_hosted.rs index 00bd50081..a3b69a99b 100644 --- a/examples/nrf52840/src/bin/wifi_esp_hosted.rs +++ b/examples/nrf52840/src/bin/wifi_esp_hosted.rs | |||
| @@ -89,14 +89,9 @@ async fn main(spawner: Spawner) { | |||
| 89 | let seed = u64::from_le_bytes(seed); | 89 | let seed = u64::from_le_bytes(seed); |
| 90 | 90 | ||
| 91 | // Init network stack | 91 | // Init network stack |
| 92 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 92 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 93 | static STACK: StaticCell<Stack<hosted::NetDriver<'static>>> = StaticCell::new(); | 93 | static STACK: StaticCell<Stack<hosted::NetDriver<'static>>> = StaticCell::new(); |
| 94 | let stack = &*STACK.init(Stack::new( | 94 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 95 | device, | ||
| 96 | config, | ||
| 97 | RESOURCES.init(StackResources::<2>::new()), | ||
| 98 | seed, | ||
| 99 | )); | ||
| 100 | 95 | ||
| 101 | unwrap!(spawner.spawn(net_task(stack))); | 96 | unwrap!(spawner.spawn(net_task(stack))); |
| 102 | 97 | ||
diff --git a/examples/rp/src/bin/ethernet_w5500_multisocket.rs b/examples/rp/src/bin/ethernet_w5500_multisocket.rs index def26b53d..aaa035a72 100644 --- a/examples/rp/src/bin/ethernet_w5500_multisocket.rs +++ b/examples/rp/src/bin/ethernet_w5500_multisocket.rs | |||
| @@ -76,7 +76,7 @@ async fn main(spawner: Spawner) { | |||
| 76 | let stack = &*STACK.init(Stack::new( | 76 | let stack = &*STACK.init(Stack::new( |
| 77 | device, | 77 | device, |
| 78 | embassy_net::Config::dhcpv4(Default::default()), | 78 | embassy_net::Config::dhcpv4(Default::default()), |
| 79 | RESOURCES.init(StackResources::<3>::new()), | 79 | RESOURCES.init(StackResources::new()), |
| 80 | seed, | 80 | seed, |
| 81 | )); | 81 | )); |
| 82 | 82 | ||
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs index 6c4a78361..8e96a114c 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs | |||
| @@ -75,11 +75,11 @@ async fn main(spawner: Spawner) { | |||
| 75 | 75 | ||
| 76 | // Init network stack | 76 | // Init network stack |
| 77 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); | 77 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 78 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 78 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 79 | let stack = &*STACK.init(Stack::new( | 79 | let stack = &*STACK.init(Stack::new( |
| 80 | device, | 80 | device, |
| 81 | embassy_net::Config::dhcpv4(Default::default()), | 81 | embassy_net::Config::dhcpv4(Default::default()), |
| 82 | RESOURCES.init(StackResources::<2>::new()), | 82 | RESOURCES.init(StackResources::new()), |
| 83 | seed, | 83 | seed, |
| 84 | )); | 84 | )); |
| 85 | 85 | ||
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs index 30a3a7463..40736bf3c 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs | |||
| @@ -74,11 +74,11 @@ async fn main(spawner: Spawner) { | |||
| 74 | 74 | ||
| 75 | // Init network stack | 75 | // Init network stack |
| 76 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); | 76 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 77 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 77 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 78 | let stack = &*STACK.init(Stack::new( | 78 | let stack = &*STACK.init(Stack::new( |
| 79 | device, | 79 | device, |
| 80 | embassy_net::Config::dhcpv4(Default::default()), | 80 | embassy_net::Config::dhcpv4(Default::default()), |
| 81 | RESOURCES.init(StackResources::<2>::new()), | 81 | RESOURCES.init(StackResources::new()), |
| 82 | seed, | 82 | seed, |
| 83 | )); | 83 | )); |
| 84 | 84 | ||
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs index 1613ed887..c79f01538 100644 --- a/examples/rp/src/bin/ethernet_w5500_udp.rs +++ b/examples/rp/src/bin/ethernet_w5500_udp.rs | |||
| @@ -72,11 +72,11 @@ async fn main(spawner: Spawner) { | |||
| 72 | 72 | ||
| 73 | // Init network stack | 73 | // Init network stack |
| 74 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); | 74 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 75 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 75 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 76 | let stack = &*STACK.init(Stack::new( | 76 | let stack = &*STACK.init(Stack::new( |
| 77 | device, | 77 | device, |
| 78 | embassy_net::Config::dhcpv4(Default::default()), | 78 | embassy_net::Config::dhcpv4(Default::default()), |
| 79 | RESOURCES.init(StackResources::<2>::new()), | 79 | RESOURCES.init(StackResources::new()), |
| 80 | seed, | 80 | seed, |
| 81 | )); | 81 | )); |
| 82 | 82 | ||
diff --git a/examples/rp/src/bin/usb_ethernet.rs b/examples/rp/src/bin/usb_ethernet.rs index 22dc88d28..03c510f37 100644 --- a/examples/rp/src/bin/usb_ethernet.rs +++ b/examples/rp/src/bin/usb_ethernet.rs | |||
| @@ -109,13 +109,8 @@ async fn main(spawner: Spawner) { | |||
| 109 | 109 | ||
| 110 | // Init network stack | 110 | // Init network stack |
| 111 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); | 111 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); |
| 112 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 112 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 113 | let stack = &*STACK.init(Stack::new( | 113 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 114 | device, | ||
| 115 | config, | ||
| 116 | RESOURCES.init(StackResources::<2>::new()), | ||
| 117 | seed, | ||
| 118 | )); | ||
| 119 | 114 | ||
| 120 | unwrap!(spawner.spawn(net_task(stack))); | 115 | unwrap!(spawner.spawn(net_task(stack))); |
| 121 | 116 | ||
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs index 4fc2690e3..11978adf1 100644 --- a/examples/rp/src/bin/wifi_ap_tcp_server.rs +++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs | |||
| @@ -81,11 +81,11 @@ async fn main(spawner: Spawner) { | |||
| 81 | 81 | ||
| 82 | // Init network stack | 82 | // Init network stack |
| 83 | static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new(); | 83 | static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new(); |
| 84 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 84 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 85 | let stack = &*STACK.init(Stack::new( | 85 | let stack = &*STACK.init(Stack::new( |
| 86 | net_device, | 86 | net_device, |
| 87 | config, | 87 | config, |
| 88 | RESOURCES.init(StackResources::<2>::new()), | 88 | RESOURCES.init(StackResources::new()), |
| 89 | seed, | 89 | seed, |
| 90 | )); | 90 | )); |
| 91 | 91 | ||
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs index 5575df677..f77932202 100644 --- a/examples/rp/src/bin/wifi_tcp_server.rs +++ b/examples/rp/src/bin/wifi_tcp_server.rs | |||
| @@ -84,11 +84,11 @@ async fn main(spawner: Spawner) { | |||
| 84 | 84 | ||
| 85 | // Init network stack | 85 | // Init network stack |
| 86 | static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new(); | 86 | static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new(); |
| 87 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 87 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 88 | let stack = &*STACK.init(Stack::new( | 88 | let stack = &*STACK.init(Stack::new( |
| 89 | net_device, | 89 | net_device, |
| 90 | config, | 90 | config, |
| 91 | RESOURCES.init(StackResources::<2>::new()), | 91 | RESOURCES.init(StackResources::new()), |
| 92 | seed, | 92 | seed, |
| 93 | )); | 93 | )); |
| 94 | 94 | ||
diff --git a/examples/rp/src/bin/wifi_webrequest.rs b/examples/rp/src/bin/wifi_webrequest.rs index 70b6f0949..1a716d1a8 100644 --- a/examples/rp/src/bin/wifi_webrequest.rs +++ b/examples/rp/src/bin/wifi_webrequest.rs | |||
| @@ -91,7 +91,7 @@ async fn main(spawner: Spawner) { | |||
| 91 | let stack = &*STACK.init(Stack::new( | 91 | let stack = &*STACK.init(Stack::new( |
| 92 | net_device, | 92 | net_device, |
| 93 | config, | 93 | config, |
| 94 | RESOURCES.init(StackResources::<5>::new()), | 94 | RESOURCES.init(StackResources::new()), |
| 95 | seed, | 95 | seed, |
| 96 | )); | 96 | )); |
| 97 | 97 | ||
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs index 59813d8cb..310e7264d 100644 --- a/examples/std/src/bin/net.rs +++ b/examples/std/src/bin/net.rs | |||
| @@ -52,12 +52,7 @@ async fn main_task(spawner: Spawner) { | |||
| 52 | // Init network stack | 52 | // Init network stack |
| 53 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); | 53 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); |
| 54 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | 54 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 55 | let stack = &*STACK.init(Stack::new( | 55 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 56 | device, | ||
| 57 | config, | ||
| 58 | RESOURCES.init(StackResources::<3>::new()), | ||
| 59 | seed, | ||
| 60 | )); | ||
| 61 | 56 | ||
| 62 | // Launch network task | 57 | // Launch network task |
| 63 | spawner.spawn(net_task(stack)).unwrap(); | 58 | spawner.spawn(net_task(stack)).unwrap(); |
diff --git a/examples/std/src/bin/net_dns.rs b/examples/std/src/bin/net_dns.rs index 3b6a3de37..c9615ef35 100644 --- a/examples/std/src/bin/net_dns.rs +++ b/examples/std/src/bin/net_dns.rs | |||
| @@ -51,12 +51,7 @@ async fn main_task(spawner: Spawner) { | |||
| 51 | // Init network stack | 51 | // Init network stack |
| 52 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); | 52 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); |
| 53 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | 53 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 54 | let stack: &Stack<_> = &*STACK.init(Stack::new( | 54 | let stack: &Stack<_> = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 55 | device, | ||
| 56 | config, | ||
| 57 | RESOURCES.init(StackResources::<3>::new()), | ||
| 58 | seed, | ||
| 59 | )); | ||
| 60 | 55 | ||
| 61 | // Launch network task | 56 | // Launch network task |
| 62 | spawner.spawn(net_task(stack)).unwrap(); | 57 | spawner.spawn(net_task(stack)).unwrap(); |
diff --git a/examples/std/src/bin/net_ppp.rs b/examples/std/src/bin/net_ppp.rs index 9ec0ea91f..c5c27c4a3 100644 --- a/examples/std/src/bin/net_ppp.rs +++ b/examples/std/src/bin/net_ppp.rs | |||
| @@ -102,7 +102,7 @@ async fn main_task(spawner: Spawner) { | |||
| 102 | let stack = &*STACK.init(Stack::new( | 102 | let stack = &*STACK.init(Stack::new( |
| 103 | device, | 103 | device, |
| 104 | Config::default(), // don't configure IP yet | 104 | Config::default(), // don't configure IP yet |
| 105 | RESOURCES.init(StackResources::<3>::new()), | 105 | RESOURCES.init(StackResources::new()), |
| 106 | seed, | 106 | seed, |
| 107 | )); | 107 | )); |
| 108 | 108 | ||
diff --git a/examples/std/src/bin/net_udp.rs b/examples/std/src/bin/net_udp.rs index bee91990d..b2ba4915a 100644 --- a/examples/std/src/bin/net_udp.rs +++ b/examples/std/src/bin/net_udp.rs | |||
| @@ -50,12 +50,7 @@ async fn main_task(spawner: Spawner) { | |||
| 50 | // Init network stack | 50 | // Init network stack |
| 51 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); | 51 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); |
| 52 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | 52 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 53 | let stack = &*STACK.init(Stack::new( | 53 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 54 | device, | ||
| 55 | config, | ||
| 56 | RESOURCES.init(StackResources::<3>::new()), | ||
| 57 | seed, | ||
| 58 | )); | ||
| 59 | 54 | ||
| 60 | // Launch network task | 55 | // Launch network task |
| 61 | spawner.spawn(net_task(stack)).unwrap(); | 56 | spawner.spawn(net_task(stack)).unwrap(); |
diff --git a/examples/std/src/bin/tcp_accept.rs b/examples/std/src/bin/tcp_accept.rs index e8b6eaa6c..39b29a449 100644 --- a/examples/std/src/bin/tcp_accept.rs +++ b/examples/std/src/bin/tcp_accept.rs | |||
| @@ -64,12 +64,7 @@ async fn main_task(spawner: Spawner) { | |||
| 64 | // Init network stack | 64 | // Init network stack |
| 65 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); | 65 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); |
| 66 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | 66 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 67 | let stack = &*STACK.init(Stack::new( | 67 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 68 | device, | ||
| 69 | config, | ||
| 70 | RESOURCES.init(StackResources::<3>::new()), | ||
| 71 | seed, | ||
| 72 | )); | ||
| 73 | 68 | ||
| 74 | // Launch network task | 69 | // Launch network task |
| 75 | spawner.spawn(net_task(stack)).unwrap(); | 70 | spawner.spawn(net_task(stack)).unwrap(); |
diff --git a/examples/stm32f4/src/bin/eth.rs b/examples/stm32f4/src/bin/eth.rs index 648c45bbd..9388c64bf 100644 --- a/examples/stm32f4/src/bin/eth.rs +++ b/examples/stm32f4/src/bin/eth.rs | |||
| @@ -89,13 +89,8 @@ async fn main(spawner: Spawner) -> ! { | |||
| 89 | 89 | ||
| 90 | // Init network stack | 90 | // Init network stack |
| 91 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); | 91 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 92 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 92 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 93 | let stack = &*STACK.init(Stack::new( | 93 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 94 | device, | ||
| 95 | config, | ||
| 96 | RESOURCES.init(StackResources::<2>::new()), | ||
| 97 | seed, | ||
| 98 | )); | ||
| 99 | 94 | ||
| 100 | // Launch network task | 95 | // Launch network task |
| 101 | unwrap!(spawner.spawn(net_task(stack))); | 96 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/stm32f4/src/bin/eth_w5500.rs b/examples/stm32f4/src/bin/eth_w5500.rs index 3c770a873..5c3c6c3ba 100644 --- a/examples/stm32f4/src/bin/eth_w5500.rs +++ b/examples/stm32f4/src/bin/eth_w5500.rs | |||
| @@ -93,13 +93,8 @@ async fn main(spawner: Spawner) -> ! { | |||
| 93 | //}); | 93 | //}); |
| 94 | 94 | ||
| 95 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); | 95 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 96 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 96 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 97 | let stack = &*STACK.init(Stack::new( | 97 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 98 | device, | ||
| 99 | config, | ||
| 100 | RESOURCES.init(StackResources::<2>::new()), | ||
| 101 | seed, | ||
| 102 | )); | ||
| 103 | 98 | ||
| 104 | // Launch network task | 99 | // Launch network task |
| 105 | unwrap!(spawner.spawn(net_task(stack))); | 100 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs index b398c35da..94e51c338 100644 --- a/examples/stm32f4/src/bin/usb_ethernet.rs +++ b/examples/stm32f4/src/bin/usb_ethernet.rs | |||
| @@ -145,13 +145,8 @@ async fn main(spawner: Spawner) { | |||
| 145 | 145 | ||
| 146 | // Init network stack | 146 | // Init network stack |
| 147 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); | 147 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); |
| 148 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 148 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 149 | let stack = &*STACK.init(Stack::new( | 149 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 150 | device, | ||
| 151 | config, | ||
| 152 | RESOURCES.init(StackResources::<2>::new()), | ||
| 153 | seed, | ||
| 154 | )); | ||
| 155 | 150 | ||
| 156 | unwrap!(spawner.spawn(net_task(stack))); | 151 | unwrap!(spawner.spawn(net_task(stack))); |
| 157 | 152 | ||
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index 41e2a6061..2fd10c8fb 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -90,13 +90,8 @@ async fn main(spawner: Spawner) -> ! { | |||
| 90 | 90 | ||
| 91 | // Init network stack | 91 | // Init network stack |
| 92 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); | 92 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 93 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 93 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 94 | let stack = &*STACK.init(Stack::new( | 94 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 95 | device, | ||
| 96 | config, | ||
| 97 | RESOURCES.init(StackResources::<2>::new()), | ||
| 98 | seed, | ||
| 99 | )); | ||
| 100 | 95 | ||
| 101 | // Launch network task | 96 | // Launch network task |
| 102 | unwrap!(spawner.spawn(net_task(stack))); | 97 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs index 2370656e6..65cfad8c9 100644 --- a/examples/stm32h5/src/bin/eth.rs +++ b/examples/stm32h5/src/bin/eth.rs | |||
| @@ -93,13 +93,8 @@ async fn main(spawner: Spawner) -> ! { | |||
| 93 | 93 | ||
| 94 | // Init network stack | 94 | // Init network stack |
| 95 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); | 95 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 96 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 96 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 97 | let stack = &*STACK.init(Stack::new( | 97 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 98 | device, | ||
| 99 | config, | ||
| 100 | RESOURCES.init(StackResources::<2>::new()), | ||
| 101 | seed, | ||
| 102 | )); | ||
| 103 | 98 | ||
| 104 | // Launch network task | 99 | // Launch network task |
| 105 | unwrap!(spawner.spawn(net_task(&stack))); | 100 | unwrap!(spawner.spawn(net_task(&stack))); |
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index 7c7964ecd..b2f8ed91e 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs | |||
| @@ -93,12 +93,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 93 | // Init network stack | 93 | // Init network stack |
| 94 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); | 94 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 95 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | 95 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 96 | let stack = &*STACK.init(Stack::new( | 96 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 97 | device, | ||
| 98 | config, | ||
| 99 | RESOURCES.init(StackResources::<3>::new()), | ||
| 100 | seed, | ||
| 101 | )); | ||
| 102 | 97 | ||
| 103 | // Launch network task | 98 | // Launch network task |
| 104 | unwrap!(spawner.spawn(net_task(&stack))); | 99 | unwrap!(spawner.spawn(net_task(&stack))); |
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs index 0639fb99f..274c24ab1 100644 --- a/examples/stm32h7/src/bin/eth_client.rs +++ b/examples/stm32h7/src/bin/eth_client.rs | |||
| @@ -93,12 +93,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 93 | // Init network stack | 93 | // Init network stack |
| 94 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); | 94 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 95 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | 95 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 96 | let stack = &*STACK.init(Stack::new( | 96 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 97 | device, | ||
| 98 | config, | ||
| 99 | RESOURCES.init(StackResources::<3>::new()), | ||
| 100 | seed, | ||
| 101 | )); | ||
| 102 | 97 | ||
| 103 | // Launch network task | 98 | // Launch network task |
| 104 | unwrap!(spawner.spawn(net_task(stack))); | 99 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/stm32h7/src/bin/eth_client_mii.rs b/examples/stm32h7/src/bin/eth_client_mii.rs index 9a52e8d3b..aa6544f41 100644 --- a/examples/stm32h7/src/bin/eth_client_mii.rs +++ b/examples/stm32h7/src/bin/eth_client_mii.rs | |||
| @@ -99,12 +99,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 99 | // Init network stack | 99 | // Init network stack |
| 100 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); | 100 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 101 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | 101 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 102 | let stack = &*STACK.init(Stack::new( | 102 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 103 | device, | ||
| 104 | config, | ||
| 105 | RESOURCES.init(StackResources::<3>::new()), | ||
| 106 | seed, | ||
| 107 | )); | ||
| 108 | 103 | ||
| 109 | // Launch network task | 104 | // Launch network task |
| 110 | unwrap!(spawner.spawn(net_task(stack))); | 105 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs index 33149144c..bd633cecb 100644 --- a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs +++ b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs | |||
| @@ -207,13 +207,8 @@ async fn main(spawner: Spawner) { | |||
| 207 | 207 | ||
| 208 | // Init network stack | 208 | // Init network stack |
| 209 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); | 209 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 210 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 210 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 211 | let stack = &*STACK.init(Stack::new( | 211 | let stack = &*STACK.init(Stack::new(device, ip_cfg, RESOURCES.init(StackResources::new()), seed)); |
| 212 | device, | ||
| 213 | ip_cfg, | ||
| 214 | RESOURCES.init(StackResources::<2>::new()), | ||
| 215 | seed, | ||
| 216 | )); | ||
| 217 | 212 | ||
| 218 | // Launch network task | 213 | // Launch network task |
| 219 | unwrap!(spawner.spawn(net_task(stack))); | 214 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs index 7f73fd677..d02bac91d 100644 --- a/examples/stm32l5/src/bin/usb_ethernet.rs +++ b/examples/stm32l5/src/bin/usb_ethernet.rs | |||
| @@ -122,13 +122,8 @@ async fn main(spawner: Spawner) { | |||
| 122 | 122 | ||
| 123 | // Init network stack | 123 | // Init network stack |
| 124 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); | 124 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); |
| 125 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | 125 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); |
| 126 | let stack = &*STACK.init(Stack::new( | 126 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 127 | device, | ||
| 128 | config, | ||
| 129 | RESOURCES.init(StackResources::<2>::new()), | ||
| 130 | seed, | ||
| 131 | )); | ||
| 132 | 127 | ||
| 133 | unwrap!(spawner.spawn(net_task(stack))); | 128 | unwrap!(spawner.spawn(net_task(stack))); |
| 134 | 129 | ||
