-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebuggerMsgs.h
65 lines (58 loc) · 2.28 KB
/
DebuggerMsgs.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*!
* @file DebuggerMsgs.h
*
* Arduino library for the RoboHeart.
*
*/
#ifndef DebuggerMsgs_h
#define DebuggerMsgs_h
#ifndef FILE_IDENTIFIER
#define FILE_IDENTIFIER ""
#endif // FILE_IDENTIFIER
#define PRINT_IDENTIFIER(dbg_identifier) \
{ \
_debug->print("["); \
_debug->print(dbg_identifier); \
_debug->print("_DBG] "); \
}
#define DEBUG_IDENTIFIER(x) \
{ \
if (_debug != NULL) { \
PRINT_IDENTIFIER(FILE_IDENTIFIER) \
_debug->print(x); \
} \
}
#define DEBUG_LN_IDENTIFIER(x) \
{ \
if (_debug != NULL) { \
PRINT_IDENTIFIER(FILE_IDENTIFIER) \
_debug->println(x); \
} \
}
#define DEBUG(x) \
{ \
if (_debug != NULL) { \
_debug->print(x); \
} \
}
#define DEBUG_LN(x) \
{ \
if (_debug != NULL) { \
_debug->println(x); \
} \
}
#define RETURN_WARN_IF_EQUAL(x, y) \
{ \
if (x == y) { \
DEBUG_LN_IDENTIFIER("Configure the struct with begin() first"); \
return; \
} \
}
#define RETURN_VAL_WARN_IF_EQUAL(x, y, val) \
{ \
if (x == y) { \
DEBUG_LN_IDENTIFIER("Configure the struct with begin() first"); \
return val; \
} \
}
#endif // DebuggerMsgs_h