debug.h 495 B

123456789101112131415161718192021222324252627
  1. #ifndef DEBUG_H_
  2. #define DEBUG_H_
  3. #include "main.h"
  4. #include "util.h"
  5. #if DEBUG && IS_ATMEGAx8
  6. void dfprintf(const char __flash *fmt, ...);
  7. #define dprintf(fmt, ...) dfprintf(PSTR(fmt) ,##__VA_ARGS__)
  8. void debug_prepare_deep_sleep(void);
  9. void debug_init(void);
  10. #else /* DEBUG && IS_ATMEGAx8 */
  11. #define dprintf(fmt, ...) do {} while (0)
  12. static inline void debug_prepare_deep_sleep(void) {}
  13. static inline void debug_init(void) {}
  14. #endif /* DEBUG && IS_ATMEGAx8 */
  15. #endif /* DEBUG_H_ */