Skip to content

Commit

Permalink
replace SERIAL macro with SERIAL_PRINT (#395)
Browse files Browse the repository at this point in the history
SERIAL already is used by the Arduino core and causes a compiler warning
  • Loading branch information
nuno-silva authored Nov 2, 2020
1 parent 39e7d5c commit 39a1188
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions examples/JeeUdp/JeeUdp.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <JeeLib.h>
#include <avr/eeprom.h>

#define DEBUG 1 // set to 1 to display free RAM on web page
#define SERIAL 1 // set to 1 to show incoming requests on serial port
#define DEBUG 1 // set to 1 to display free RAM on web page
#define SERIAL_PRINT 1 // set to 1 to show incoming requests on serial port

#define CONFIG_EEPROM_ADDR ((byte*) 0x10)

Expand Down Expand Up @@ -177,7 +177,7 @@ static void sendPage (const char* data, BufferFiller& buf) {
outBuf[outCount] = 10 * outBuf[outCount] + (*p - '0');
++outCount;
}
#if SERIAL
#if SERIAL_PRINT
Serial.print("Send to ");
Serial.print(outDest, DEC);
Serial.print(':');
Expand Down Expand Up @@ -250,7 +250,7 @@ static void forwardToUDP () {
collectPayload(0x0006);

ether.sendUdp ((char*) collBuf, collPos, 23456, destIp, config.port);
#if SERIAL
#if SERIAL_PRINT
Serial.println("UDP sent");
#endif
}
Expand All @@ -275,7 +275,7 @@ void loop (){
if (pos) {
bfill = ether.tcpOffset();
char* data = (char *) Ethernet::buffer + pos;
#if SERIAL
#if SERIAL_PRINT
Serial.println(data);
#endif
// receive buf hasn't been clobbered by reply yet
Expand Down Expand Up @@ -306,7 +306,7 @@ void loop (){
msgs_rcvd = (msgs_rcvd + 1) % 10000;

if (RF12_WANTS_ACK && !config.collect) {
#if SERIAL
#if SERIAL_PRINT
Serial.println(" -> ack");
#endif
rf12_sendStart(RF12_ACK_REPLY);
Expand Down
14 changes: 7 additions & 7 deletions examples/etherNode/etherNode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include <JeeLib.h>
#include <avr/eeprom.h>

#define DEBUG 1 // set to 1 to display free RAM on web page
#define SERIAL 0 // set to 1 to show incoming requests on serial port
#define DEBUG 1 // set to 1 to display free RAM on web page
#define SERIAL_PRINT 0 // set to 1 to show incoming requests on serial port

#define CONFIG_EEPROM_ADDR ((byte*) 0x10)

Expand Down Expand Up @@ -179,7 +179,7 @@ static void sendPage(const char* data, BufferFiller& buf) {
outBuf[outCount] = 10 * outBuf[outCount] + (*p - '0');
++outCount;
}
#if SERIAL
#if SERIAL_PRINT
Serial.print("Send to ");
Serial.print(outDest, DEC);
Serial.print(':');
Expand Down Expand Up @@ -210,7 +210,7 @@ static void sendPage(const char* data, BufferFiller& buf) {
}

void setup(){
#if SERIAL
#if SERIAL_PRINT
Serial.begin(57600);
Serial.println("\n[etherNode]");
#endif
Expand All @@ -221,7 +221,7 @@ void setup(){
Serial.println( "Failed to access Ethernet controller");
if (!ether.dhcpSetup())
Serial.println("DHCP failed");
#if SERIAL
#if SERIAL_PRINT
ether.printIp("IP: ", ether.myip);
#endif
}
Expand All @@ -233,7 +233,7 @@ void loop(){
if (pos) {
bfill = ether.tcpOffset();
char* data = (char *) Ethernet::buffer + pos;
#if SERIAL
#if SERIAL_PRINT
Serial.println(data);
#endif
// receive buf hasn't been clobbered by reply yet
Expand Down Expand Up @@ -264,7 +264,7 @@ void loop(){
msgs_rcvd = (msgs_rcvd + 1) % 10000;

if (RF12_WANTS_ACK && !config.collect) {
#if SERIAL
#if SERIAL_PRINT
Serial.println(" -> ack");
#endif
rf12_sendStart(RF12_ACK_REPLY);
Expand Down
2 changes: 1 addition & 1 deletion src/tcpip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ static uint16_t tcp_datafill_cb(uint8_t fd) {
Stash::extract(0, len, EtherCard::tcpOffset());
Stash::cleanup();
EtherCard::tcpOffset()[len] = 0;
#if SERIAL
#if SERIAL_PRINT
Serial.print("REQUEST: ");
Serial.println(len);
Serial.println((char*) EtherCard::tcpOffset());
Expand Down

0 comments on commit 39a1188

Please sign in to comment.