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?
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.:
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?