diff options
author | Leo C | 2014-08-12 12:35:28 +0200 |
---|---|---|
committer | Leo C | 2014-08-12 12:35:28 +0200 |
commit | d684c21619905153eff68c43927207248925f6c2 (patch) | |
tree | c4bfb04a20512679103c6ad39fd9885dea6d9e76 /avr/debug.h | |
parent | 9b6b4b31e8cb284ad6a68fe16d458e36bbfb46fa (diff) | |
download | z180-stamp-d684c21619905153eff68c43927207248925f6c2.zip |
New U-Boot like AVR main program.
Uses U-Boot source code taken from:
git://git.denx.de/u-boot.git
Diffstat (limited to 'avr/debug.h')
-rw-r--r-- | avr/debug.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/avr/debug.h b/avr/debug.h index ea67a99..1815166 100644 --- a/avr/debug.h +++ b/avr/debug.h @@ -2,13 +2,33 @@ #ifndef DEBUG_H_ #define DEBUG_H_ +#include "common.h" #include <avr/pgmspace.h> #ifdef DEBUG +#define _DEBUG 1 +#else +#define _DEBUG 0 +#endif + +#define debug_cond(cond, fmt, args...) \ + do { \ + if (cond) \ + printf_P(PSTR(fmt), ##args); \ + } while (0) + +#define debug(fmt, args...) \ + debug_cond(_DEBUG, fmt, ##args) + + +#if 1 +#ifdef DEBUG #define DBG_P(lvl, format, ...) if (DEBUG>=lvl) \ fprintf_P( stdout, PSTR(format), ##__VA_ARGS__ ) #else #define DBG_P(lvl, ...) #endif +#endif /* 0 */ #endif /* DEBUG_H_ */ + |