ekstrand / ESP8266wifi

ESP8266 Arduino library with built in reconnect functionality
MIT License
450 stars 235 forks source link

Anomole #68

Open SteveRMann opened 5 years ago

SteveRMann commented 5 years ago

This is not an issue more than a curiosity.

I use these two lines at the start of many of my Arduino and ESP sketches to turn Serial.print on or off with one #define statement.:

#define DEBUG true  //set to true for debug output, false for no debug output
#define Serial if(DEBUG)Serial

It works. Except when I add #include . I then get a compile error:

expected primary-expression before 'if' It's not a show-stopper because the "feature" is simply a convenience, but examining the cpp code in the library is a bit above my skill level. I am simply curious what is in the ESP8266WiFi.h that would prevent me using the debug lines?