aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f4/src/bin/eth.rs
diff options
context:
space:
mode:
authorTyler <[email protected]>2023-09-29 20:02:24 -0600
committerGitHub <[email protected]>2023-09-29 20:02:24 -0600
commit2f9b59c5cf21f1e2761a9ccefdfd86f0edea829c (patch)
tree8964744b4fb753cf98f6f413464106c4d2a72976 /examples/stm32f4/src/bin/eth.rs
parentce91fb2bfc846570ef543a09396c428d70675245 (diff)
parent95b3d9eb3b3657de3d7bc9c04f8fb83eae901640 (diff)
Merge branch 'main' into issue-1974-add-sai-driver
Diffstat (limited to 'examples/stm32f4/src/bin/eth.rs')
-rw-r--r--examples/stm32f4/src/bin/eth.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/stm32f4/src/bin/eth.rs b/examples/stm32f4/src/bin/eth.rs
index 393e60b73..16bf5d949 100644
--- a/examples/stm32f4/src/bin/eth.rs
+++ b/examples/stm32f4/src/bin/eth.rs
@@ -79,7 +79,10 @@ async fn main(spawner: Spawner) -> ! {
79 )); 79 ));
80 80
81 // Launch network task 81 // Launch network task
82 unwrap!(spawner.spawn(net_task(&stack))); 82 unwrap!(spawner.spawn(net_task(stack)));
83
84 // Ensure DHCP configuration is up before trying connect
85 stack.wait_config_up().await;
83 86
84 info!("Network task initialized"); 87 info!("Network task initialized");
85 88
@@ -97,6 +100,7 @@ async fn main(spawner: Spawner) -> ! {
97 let r = socket.connect(remote_endpoint).await; 100 let r = socket.connect(remote_endpoint).await;
98 if let Err(e) = r { 101 if let Err(e) = r {
99 info!("connect error: {:?}", e); 102 info!("connect error: {:?}", e);
103 Timer::after(Duration::from_secs(1)).await;
100 continue; 104 continue;
101 } 105 }
102 info!("connected!"); 106 info!("connected!");
@@ -105,7 +109,7 @@ async fn main(spawner: Spawner) -> ! {
105 let r = socket.write_all(&buf).await; 109 let r = socket.write_all(&buf).await;
106 if let Err(e) = r { 110 if let Err(e) = r {
107 info!("write error: {:?}", e); 111 info!("write error: {:?}", e);
108 continue; 112 break;
109 } 113 }
110 Timer::after(Duration::from_secs(1)).await; 114 Timer::after(Duration::from_secs(1)).await;
111 } 115 }