aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/eth.rs
diff options
context:
space:
mode:
authorPaweł Jan Czochański <[email protected]>2023-01-18 10:10:33 +0100
committerDario Nieuwenhuis <[email protected]>2023-01-19 14:44:01 +0100
commit8f4fae9b36f017a8ab65491ef49b72499a9486dc (patch)
treed5bd2b0df691d7602507093426c3ee5a498c8c5f /examples/stm32h7/src/bin/eth.rs
parent2eae12b7f1cbe38d850ebf30f23a776323815af6 (diff)
Add smoltcp dhcp socket configuration
Diffstat (limited to 'examples/stm32h7/src/bin/eth.rs')
-rw-r--r--examples/stm32h7/src/bin/eth.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs
index 551325ca4..ad7fcc5c0 100644
--- a/examples/stm32h7/src/bin/eth.rs
+++ b/examples/stm32h7/src/bin/eth.rs
@@ -70,20 +70,15 @@ async fn main(spawner: Spawner) -> ! {
70 0, 70 0,
71 ); 71 );
72 72
73 let config = embassy_net::ConfigStrategy::Dhcp; 73 let config = embassy_net::Config::Dhcp(Default::default());
74 //let config = embassy_net::ConfigStrategy::Static(embassy_net::Config { 74 //let config = embassy_net::Config::Static(embassy_net::StaticConfig {
75 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 75 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
76 // dns_servers: Vec::new(), 76 // dns_servers: Vec::new(),
77 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 77 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
78 //}); 78 //});
79 79
80 // Init network stack 80 // Init network stack
81 let stack = &*singleton!(Stack::new( 81 let stack = &*singleton!(Stack::new(device, config, singleton!(StackResources::<1>::new()), seed));
82 device,
83 config,
84 singleton!(StackResources::<1, 2, 8>::new()),
85 seed
86 ));
87 82
88 // Launch network task 83 // Launch network task
89 unwrap!(spawner.spawn(net_task(&stack))); 84 unwrap!(spawner.spawn(net_task(&stack)));