]> cloudbase.mooo.com Git - z180-stamp.git/blame - include/debug.h
Put unicode tables in flash
[z180-stamp.git] / include / debug.h
CommitLineData
0c5890bb
L
1
2#ifndef DEBUG_H_
3#define DEBUG_H_
4
d684c216 5#include "common.h"
e7895944 6
d684c216
L
7#ifdef DEBUG
8#define _DEBUG 1
9#else
10#define _DEBUG 0
11#endif
12
13#define debug_cond(cond, fmt, args...) \
14 do { \
15 if (cond) \
16 printf_P(PSTR(fmt), ##args); \
17 } while (0)
18
19#define debug(fmt, args...) \
20 debug_cond(_DEBUG, fmt, ##args)
21
22
23#if 1
0c5890bb 24#ifdef DEBUG
e7895944 25#define DBG_P(lvl, format, ...) if (DEBUG>=lvl) \
9b6b4b31 26 fprintf_P( stdout, PSTR(format), ##__VA_ARGS__ )
0c5890bb
L
27#else
28#define DBG_P(lvl, ...)
29#endif
d684c216 30#endif /* 0 */
0c5890bb 31
69988dc1
L
32
33void printfreelist(const char * title);
34
35
0c5890bb 36#endif /* DEBUG_H_ */