Simple Arduino FSM
LogConfiguration.h
Go to the documentation of this file.
1 
15 #ifndef LOGCONFIGURATION_H
16 #define LOGCONFIGURATION_H
17 
18 #define DEBUGGER true
19 
20 #ifdef DEBUGGER
21 #define DEBUG_ERROR
22 #define DEBUG_WARNING
23 #define DEBUG_STATUS
24 #define DEBUG_EVENT
25 #define DEBUG_INFO1
26 #define DEBUG_INFO2
27 #define DEBUG_INFO3
28 #define DEBUG_FUNCCALL
29 #endif
30 
31 #ifdef DEBUG_ERROR
32 #define DBERROR(x) \
33  Serial.print("ERROR: "); \
34  Serial.println(x);
35 #else
36 #define DBERROR(x)
37 #endif
38 
39 #ifdef DEBUG_WARNING
40 #define DBWARNING(x) Serial.print(x)
41 #define DBWARNINGln(x) Serial.println(x)
42 #else
43 #define DBWARNING(x)
44 #define DBWARNINGln(x)
45 #endif
46 
47 #ifdef DEBUG_STATUS
48 #define DBSTATUS(x) Serial.print(x)
49 #define DBSTATUSln(x) Serial.println(x)
50 #else
51 #define DBSTATUS(x)
52 #define DBSTATUSln(x)
53 #endif
54 
55 #ifdef DEBUG_EVENT
56 #define DBEVENT(x) Serial.print(x)
57 #define DBEVENTln(x) Serial.println(x)
58 #else
59 #define DBEVENT(x)
60 #define DBEVENTln(x)
61 #endif
62 
63 #ifdef DEBUG_INFO1
64 #define DBINFO1(x) \
65  if (Serial) { \
66  Serial.print(x); \
67  };
68 #define DBINFO1ln(x) \
69  if (Serial) { \
70  Serial.println(x); \
71  };
72 #else
73 #define DBINFO1(x)
74 #define DBINFO1ln(x)
75 #endif
76 
77 #ifdef DEBUG_INFO2
78 #define DBINFO2(x) \
79  if (Serial) { \
80  Serial.print(x); \
81  };
82 #define DBINFO2ln(x) \
83  if (Serial) { \
84  Serial.println(x); \
85  };
86 #else
87 #define DBINFO2(x)
88 #define DBINFO2ln(x)
89 #endif
90 
91 #ifdef DEBUG_INFO3
92 #define DBINFO3(x) \
93  if (Serial) { \
94  Serial.print(x); \
95  };
96 #define DBINFO3ln(x) \
97  if (Serial) { \
98  Serial.println(x); \
99  };
100 #else
101 #define DBINFO3(x)
102 #define DBINFO3ln(x)
103 #endif
104 
105 #ifdef DEBUG_FUNCCALL
106 #define DBFUNCCALL(x) \
107  if (Serial) { \
108  Serial.print(x); \
109  }
110 #define DBFUNCCALLln(x) \
111  if (Serial) { \
112  Serial.println(x); \
113  }
114 #else
115 #define DBFUNCCALL(x)
116 #define DBFUNCCALLln(x)
117 #endif
118 
119 #endif