add progmem compatible debug and info functions

This commit is contained in:
optixx
2009-08-28 12:30:16 +02:00
parent 710aa2d53a
commit bb1367c243
5 changed files with 72 additions and 5 deletions

View File

@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdarg.h>
#include <avr/pgmspace.h>
#if defined(NO_DEBUG) && defined(__GNUC__)
/* gcc's cpp has extensions; it allows for macros with a variable number of
@@ -39,5 +39,17 @@ void debug(int level, char *format, ...);
#endif
#if defined(NO_DEBUG) && defined(__GNUC__)
/* gcc's cpp has extensions; it allows for macros with a variable number of
arguments. We use this extension here to preprocess pmesg away. */
#define debug_P(level, format, args...) ((void)0)
#else
void debug_P(int level, PGM_P format, ...);
/* print a message, if it is considered significant enough.
Adapted from [K&R2], p. 174 */
#endif
#endif /* DEBUG_H */