-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdebug_utils.h
41 lines (31 loc) · 1.09 KB
/
debug_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
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
#include <Arduino.h>
#ifdef DEBUG
#define DEBUG_PRINT(str) \
Serial.print(millis()); \
Serial.print(": "); \
Serial.print(__PRETTY_FUNCTION__); \
Serial.print(':'); \
Serial.print(__LINE__); \
Serial.print(' '); \
Serial.println(str);
#else
#define DEBUG_PRINT(str)
#endif
#endif