Skip to content

Commit 7b6f193

Browse files
committed
ethernet: fix TelnetClient wait for serial
1 parent 076840f commit 7b6f193

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libraries/Ethernet/examples/TelnetClient/TelnetClient.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ int port = 23; // Telnet port
2828
ZephyrClient client;
2929

3030
void setup() {
31+
// Open serial communications and wait for port to open:
32+
Serial.begin(9600);
33+
while (!Serial) {
34+
; // wait for serial port to connect. Needed for native USB port only
35+
}
36+
3137
// Check for Ethernet hardware present
3238
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
3339
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
@@ -45,12 +51,6 @@ void setup() {
4551
// start the Ethernet connection:
4652
Ethernet.begin(ip);
4753

48-
// Open serial communications and wait for port to open:
49-
Serial.begin(9600);
50-
while (!Serial) {
51-
; // wait for serial port to connect. Needed for native USB port only
52-
}
53-
5454
// give the Ethernet shield a second to initialize:
5555
delay(1000);
5656
Serial.println("connecting...");

0 commit comments

Comments
 (0)