-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdebug.h
49 lines (40 loc) · 1.29 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef _DEBUG_H_
#define _DEBUG_H_
//----------------------------------------------------------------------------
#define PKT_DEBUG 0
#define KEY_DEBUG 0
#define RUN_DEBUG 0
#define INF_DEBUG 0
//----------------------------------------------------------------------------
#include <stdio.h>
#include <syslog.h>
//----------------------------------------------------------------------------
#if PKT_DEBUG == 1
# define PKTDBGF(...) do{ printf(__VA_ARGS__); fflush(stdout); }while(0)
#else
# define PKTDBGF(...) (void)0
#endif
#if RUN_DEBUG == 1
# define RUNDBGF(...) do{ printf(__VA_ARGS__); fflush(stdout); }while(0)
#else
# define RUNDBGF(...) (void)0
#endif
#if KEY_DEBUG == 1
# define KEYDBGF(...) do{ printf(__VA_ARGS__); fflush(stdout); }while(0)
#else
# define KEYDBGF(...) (void)0
#endif
#if INF_DEBUG == 1
//# define INFOF(...) do{ printf(__VA_ARGS__); fflush(stdout); }while(0)
# define INFOF(...) do{ syslog(LOG_NOTICE, __VA_ARGS__); }while(0)
#else
# define INFOF(...) (void)0
#endif
//----------------------------------------------------------------------------
#include <stdint.h>
//----------------------------------------------------------------------------
void spin (void) ;
void dumpBuf (uint8_t* buf) ;
char* timestamp (void) ;
void showStatus (void) ;
#endif // _DEBUG_H_