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/stm32h7 | |
| parent | 21edbd3c17837f9a3f196fe1bdda4a065805d12f (diff) | |
examples: ensure at least 3 sockets to avoid running out (DHCP, DNS, the user's)
Diffstat (limited to 'examples/stm32h7')
| -rw-r--r-- | examples/stm32h7/src/bin/eth.rs | 7 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/eth_client.rs | 7 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/eth_client_mii.rs | 7 |
3 files changed, 3 insertions, 18 deletions
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))); |
