Skip to content

Commit 716a208

Browse files
committed
ethernet: uniform example Waiting for link on
1 parent 847a80b commit 716a208

File tree

9 files changed

+18
-30
lines changed

9 files changed

+18
-30
lines changed

libraries/Ethernet/examples/AdvancedChatServer/AdvancedChatServer.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@ void setup() {
5353
}
5454

5555
// in Zephyr system check if Ethernet is ready before proceeding to initialize
56-
Serial.print("Waiting for link on");
5756
while (Ethernet.linkStatus() != LinkON) {
58-
Serial.print(".");
59-
delay(100);
57+
Serial.println("Waiting for link on");
58+
delay(100);
6059
}
61-
Serial.println();
6260

6361
// initialize the Ethernet device
6462
Ethernet.begin(ip, myDns, gateway, subnet);

libraries/Ethernet/examples/BarometricPressureWebServer/BarometricPressureWebServer.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,10 @@ void setup() {
6565
}
6666

6767
// in Zephyr system check if Ethernet is ready before proceeding to initialize
68-
Serial.print("Waiting for link on");
6968
while (Ethernet.linkStatus() != LinkON) {
70-
Serial.print(".");
71-
delay(100);
69+
Serial.println("Waiting for link on");
70+
delay(100);
7271
}
73-
Serial.println();
7472

7573
// start the Ethernet connection
7674
Ethernet.begin(ip);

libraries/Ethernet/examples/DhcpAddressPrinter/DhcpAddressPrinter.ino

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ void setup()
1818
}
1919

2020
// in Zephyr system check if Ethernet is ready before proceeding to initialize
21-
Serial.print("Waiting for link on");
2221
while (Ethernet.linkStatus() != LinkON) {
23-
Serial.print(".");
22+
Serial.println("Waiting for link on");
2423
delay(100);
2524
}
26-
Serial.println();
2725

2826
// start the Ethernet connection:
2927
Serial.println("Initialize Ethernet with DHCP:");

libraries/Ethernet/examples/TelnetClient/TelnetClient.ino

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ void setup() {
3535
delay(1); // do nothing, no point running without Ethernet hardware
3636
}
3737
}
38-
while (Ethernet.linkStatus() == LinkOFF) {
39-
Serial.println("Ethernet cable is not connected.");
40-
delay(500);
38+
39+
// in Zephyr system check if Ethernet is ready before proceeding to initialize
40+
while (Ethernet.linkStatus() != LinkON) {
41+
Serial.println("Waiting for link on");
42+
delay(100);
4143
}
4244

4345
// start the Ethernet connection:

libraries/Ethernet/examples/UDPSendReceiveString/UDPSendReceiveString.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ void setup() {
2828
while (!Serial) {
2929
; // wait for serial port to connect. Needed for native USB port only
3030
}
31-
31+
3232
// in Zephyr system check if Ethernet is ready before proceeding to initialize
33-
Serial.print("Waiting for link on");
3433
while (Ethernet.linkStatus() != LinkON) {
35-
Serial.print(".");
34+
Serial.println("Waiting for link on");
3635
delay(100);
3736
}
38-
Serial.println();
3937

4038
// start the Ethernet
4139
Ethernet.begin(ip);

libraries/Ethernet/examples/UdpNtpClient/UdpNtpClient.ino

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ void setup() {
3131
}
3232

3333
// in Zephyr system check if Ethernet is ready before proceeding to initialize
34-
Serial.print("Waiting for link on");
3534
while (Ethernet.linkStatus() != LinkON) {
36-
Serial.print(".");
35+
Serial.println("Waiting for link on");
3736
delay(100);
3837
}
39-
Serial.println();
4038

4139
// start Ethernet and UDP
4240
if (Ethernet.begin() == 0) {

libraries/Ethernet/examples/WebClient/WebClient.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ void setup()
4040

4141
// in Zephyr system check if Ethernet is ready before proceeding to initialize
4242
while (Ethernet.linkStatus() != LinkON) {
43-
Serial.println("Waiting for link on");
44-
delay(100);
43+
Serial.println("Waiting for link on");
44+
delay(100);
4545
}
4646

4747
// start the Ethernet connection:

libraries/Ethernet/examples/WebClientRepeating/WebClientRepeating.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ void setup() {
3939
}
4040

4141
// in Zephyr system check if Ethernet is ready before proceeding to initialize
42-
Serial.print("Waiting for link on");
4342
while (Ethernet.linkStatus() != LinkON) {
44-
Serial.print(".");
45-
delay(100);
43+
Serial.println("Waiting for link on");
44+
delay(100);
4645
}
47-
Serial.println();
4846

4947
// start the Ethernet connection:
5048
Serial.println("Initialize Ethernet with DHCP:");

libraries/Ethernet/examples/WebClientRepeatingSSL/WebClientRepeatingSSL.ino

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ void setup()
3232
}
3333

3434
// in Zephyr system check if Ethernet is ready before proceeding to initialize
35-
Serial.print("Waiting for link on");
3635
while (Ethernet.linkStatus() != LinkON) {
37-
Serial.print(".");
36+
Serial.println("Waiting for link on");
3837
delay(100);
3938
}
40-
Serial.println();
4139

4240
// start the Ethernet connection:
4341
Serial.println("Initialize Ethernet with DHCP:");

0 commit comments

Comments
 (0)