forked from lerwys/fcs-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.h
31 lines (25 loc) · 763 Bytes
/
debug.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
//============================================================================
// Author : Lucas Russo
// Version : 1.0
// Description : Common definitons for supporting different boards
//============================================================================
#ifndef DEBUG_H
#define DEBUG_H
#include <stdarg.h>
void debug_print (const char *fmt, ...) __attribute__((format(printf,1,2)));
// Debug print
#ifdef DEBUG
#define dbg_print(fmt, ...) \
debug_print(fmt, ## __VA_ARGS__)
#else
#define dbg_print(fmt, ...)
#endif /* Debug print */
#ifdef DEBUG
#define DEBUGP(fmt, ...) \
do{ \
dbg_print(fmt, ## __VA_ARGS__); \
} while(0)
#else
#define DEBUGP(fmt, ...)
#endif
#endif