diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-08-05 21:38:30 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-08-07 14:58:20 +0200 |
| commit | 59cb1531c91386cec8d7b209630b6b4d9eb7fd7c (patch) | |
| tree | 9d5268c5fc9ea6014a69313eeff268b5d3aed256 /examples/stm32f4 | |
| parent | 21edbd3c17837f9a3f196fe1bdda4a065805d12f (diff) | |
examples: ensure at least 3 sockets to avoid running out (DHCP, DNS, the user's)
Diffstat (limited to 'examples/stm32f4')
| -rw-r--r-- | examples/stm32f4/src/bin/eth.rs | 9 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/eth_w5500.rs | 9 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/usb_ethernet.rs | 9 |
3 files changed, 6 insertions, 21 deletions
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 | ||
