Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it clearer how to free up the hardware serial for debugging. #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/utility/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ along with The Arduino WiFiEsp library. If not, see
#define _ESPLOGLEVEL_ 3
#endif


/*
* Logging by default is over the hardware serial interface.
* Define _ESPCUSTOMLOGFACILITY_ if you need the hardware interface for other purposes
* (e.g. for fast connections to the ESP8266 on boards with only one hardware serial).
* In that case you need to provide your own definitions for LOGERROR, LOGDEBUG etc.
* somewhere.
*/
#ifndef _ESPCUSTOMLOGFACILITY_
#define LOGERROR(x) if(_ESPLOGLEVEL_>0) { Serial.print("[WiFiEsp] "); Serial.println(x); }
#define LOGERROR1(x,y) if(_ESPLOGLEVEL_>2) { Serial.print("[WiFiEsp] "); Serial.print(x); Serial.print(" "); Serial.println(y); }
#define LOGWARN(x) if(_ESPLOGLEVEL_>1) { Serial.print("[WiFiEsp] "); Serial.println(x); }
Expand All @@ -44,6 +51,7 @@ along with The Arduino WiFiEsp library. If not, see
#define LOGDEBUG0(x) if(_ESPLOGLEVEL_>3) { Serial.print(x); }
#define LOGDEBUG1(x,y) if(_ESPLOGLEVEL_>3) { Serial.print(x); Serial.print(" "); Serial.println(y); }
#define LOGDEBUG2(x,y,z) if(_ESPLOGLEVEL_>3) { Serial.print(x); Serial.print(" "); Serial.print(y); Serial.print(" "); Serial.println(z); }
#endif


#endif