Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
DebugVal.hpp
Go to the documentation of this file.
1#define COUNT(...) COUNT_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
2#define COUNT_HELPER(N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N, ...) N
3
4#define DEBUGVALN(N) DEBUGVALN_HELPER(N)
5#define DEBUGVALN_HELPER(N) DEBUGVAL##N
6
7#define DEBUGVAL10(x, ...) \
8 do { \
9 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
10 DEBUGVAL9(__VA_ARGS__); \
11 } while (0)
12#define DEBUGVAL9(x, ...) \
13 do { \
14 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
15 DEBUGVAL8(__VA_ARGS__); \
16 } while (0)
17#define DEBUGVAL8(x, ...) \
18 do { \
19 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
20 DEBUGVAL7(__VA_ARGS__); \
21 } while (0)
22#define DEBUGVAL7(x, ...) \
23 do { \
24 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
25 DEBUGVAL6(__VA_ARGS__); \
26 } while (0)
27#define DEBUGVAL6(x, ...) \
28 do { \
29 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
30 DEBUGVAL5(__VA_ARGS__); \
31 } while (0)
32#define DEBUGVAL5(x, ...) \
33 do { \
34 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
35 DEBUGVAL4(__VA_ARGS__); \
36 } while (0)
37#define DEBUGVAL4(x, ...) \
38 do { \
39 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
40 DEBUGVAL3(__VA_ARGS__); \
41 } while (0)
42#define DEBUGVAL3(x, ...) \
43 do { \
44 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
45 DEBUGVAL2(__VA_ARGS__); \
46 } while (0)
47#define DEBUGVAL2(x, ...) \
48 do { \
49 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
50 DEBUGVAL1(__VA_ARGS__); \
51 } while (0)
52#define DEBUGVAL1(x) \
53 do { \
54 DEBUG_OUT << NAMEDVALUE(x) << DEBUG_ENDL; \
55 } while (0)