-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebugMacro.h
45 lines (37 loc) · 1.36 KB
/
DebugMacro.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
42
43
44
45
/*
DebugMacro.h - Defines macros for debugging via Serial puproses. Macros depends on another macro DEBUG.
*/
#ifndef DebugMacro_h
#define DebugMacro_h
#ifdef DEBUG
#define DPRINT(...) Serial.print(__VA_ARGS__)
#define DPRINTF(...) Serial.printf(__VA_ARGS__)
#define DPRINTLN(...) Serial.println(__VA_ARGS__)
#define DPRINTFF(...) Serial.print(F(__VA_ARGS__))
#define DPRINTLNF(...) Serial.println(F(__VA_ARGS__))
#else
#define DPRINT(...) //blank line
#define DPRINTF(...) //blank line
#define DPRINTLN(...) //blank line
#define DPRINTFF(...) //blank line
#define DPRINTLNF(...) //blank line
#endif
#endif // end of DebugMacro_h
// #define DEBUG
// #define DEBUG_OI Serial
// #ifdef DEBUG
// #define DebugBegin(...) DEBUG_OI.begin(__VA_ARGS__)
// #define DebugPrint(...) DEBUG_OI.print(__VA_ARGS__)
// #define DebugPrintln(...) DEBUG_OI.println(__VA_ARGS__)
// #define DebugPrintf(...) DEBUG_OI.printf(__VA_ARGS__)
// #define DebugWrite(...) DEBUG_OI.write(__VA_ARGS__)
// #define DebugFlush(...) DEBUG_OI.flush(__VA_ARGS__)
// #else
// // Define the counterparts that cause the compiler to generate no code
// #define DebugBegin(...) (void(0))
// #define DebugPrint(...) (void(0))
// #define DebugPrintln(...) (void(0))
// #define DebugPrintf(...) (void(0))
// #define DebugWrite(...) (void(0))
// #define DebugFlush(...) (void(0))
// #endif