Skip to content

Commit 8b57a1d

Browse files
add ability to use Arduino Yun and ENC28J60-based shields. cleaned up file
1 parent 3dca365 commit 8b57a1d

File tree

3 files changed

+195
-87
lines changed

3 files changed

+195
-87
lines changed

examples/StandardFirmataEthernet/EthernetClientStream.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222

2323
#define MILLIS_RECONNECT 5000
2424

25+
#define DEBUG
26+
#ifdef DEBUG
27+
#define DEBUG_PRINTLN(x) Serial.println (x)
28+
#define DEBUG_PRINT(x) Serial.print (x)
29+
#else
30+
#define DEBUG_PRINTLN(x)
31+
#define DEBUG_PRINT(x)
32+
#endif
33+
2534
EthernetClientStream::EthernetClientStream(Client &client, IPAddress localip, IPAddress ip, const char* host, uint16_t port)
2635
: ip(ip),
2736
host(host),
@@ -96,9 +105,9 @@ EthernetClientStream::maintain()
96105
connected = host ? client.connect(host,port) : client.connect(ip,port);
97106
if (!connected) {
98107
time_connect = millis();
99-
Serial.println("connection failed");
108+
DEBUG_PRINTLN("connection failed");
100109
} else {
101-
Serial.println("connected");
110+
DEBUG_PRINTLN("connected");
102111
}
103112
}
104113
return connected;

examples/StandardFirmataEthernet/EthernetClientStream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ class EthernetClientStream : public Stream
4949
void stop();
5050
};
5151

52-
#endif
52+
#endif

0 commit comments

Comments
 (0)