Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1993 | - | 1 | /* |
2 | DebugUtils.h - Simple debugging utilities. |
||
3 | Copyright (C) 2011 Fabio Varesano <fabio at varesano dot net> |
||
4 | |||
5 | Ideas taken from: |
||
6 | http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1271517197 |
||
7 | |||
8 | This program is free software: you can redistribute it and/or modify |
||
9 | it under the terms of the version 3 GNU General Public License as |
||
10 | published by the Free Software Foundation. |
||
11 | |||
12 | This program is distributed in the hope that it will be useful, |
||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
15 | GNU General Public License for more details. |
||
16 | |||
17 | You should have received a copy of the GNU General Public License |
||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
||
19 | |||
20 | */ |
||
21 | |||
22 | #ifndef DEBUGUTILS_H |
||
23 | #define DEBUGUTILS_H |
||
24 | |||
25 | #ifdef DEBUG_V |
||
26 | #include <WProgram.h> |
||
27 | #define DEBUG_PRINT(str) \ |
||
28 | Serial.print(millis()); \ |
||
29 | Serial.print(": "); \ |
||
30 | Serial.print(__PRETTY_FUNCTION__); \ |
||
31 | Serial.print(' '); \ |
||
32 | Serial.print(__FILE__); \ |
||
33 | Serial.print(':'); \ |
||
34 | Serial.print(__LINE__); \ |
||
35 | Serial.print(' '); \ |
||
36 | Serial.println(str); |
||
37 | #endif |
||
38 | |||
39 | #ifdef DEBUG |
||
40 | #define DEBUG_PRINT(str) \ |
||
41 | Serial.println(str); |
||
42 | #endif |
||
43 | |||
44 | #ifndef DEBUG_PRINT |
||
45 | #define DEBUG_PRINT(str) |
||
46 | #endif |
||
47 | |||
48 | |||
49 | #endif //DEBUGUTILS_H |