Skip to content
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
33 changes: 15 additions & 18 deletions libraries/DebugUtils/DebugUtils.h
Original file line number Diff line number Diff line change
@@ -1,49 +1,46 @@
/*
DebugUtils.h - Simple debugging utilities.
Copyright (C) 2011 Fabio Varesano <fabio at varesano dot net>

Ideas taken from:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1271517197

This program is free software: you can redistribute it and/or modify
it under the terms of the version 3 GNU General Public License as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef DEBUGUTILS_H
#define DEBUGUTILS_H

#ifdef DEBUG_V
#include <WProgram.h>
#define DEBUG_PRINT(str) \
Serial.print(millis()); \
Serial.print(": "); \
#include <WProgram.h>
#define DEBUG_PRINT(str) \
Serial.print(millis()); \
Serial.print(": "); \
Serial.print(__PRETTY_FUNCTION__); \
Serial.print(' '); \
Serial.print(__FILE__); \
Serial.print(':'); \
Serial.print(__LINE__); \
Serial.print(' '); \
Serial.print(' '); \
Serial.print(__FILE__); \
Serial.print(':'); \
Serial.print(__LINE__); \
Serial.print(' '); \
Serial.println(str);
#endif

#ifdef DEBUG
#define DEBUG_PRINT(str) \
#define DEBUG_PRINT(str) \
Serial.print(str);
#define DEBUG_PRINTLN(str) \
Serial.println(str);
#endif

#ifndef DEBUG_PRINT
#define DEBUG_PRINT(str)
#define DEBUG_PRINT(str)
#define DEBUG_PRINTLN(str)
#endif


#endif //DEBUGUTILS_H