123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- #ifndef DEBUG_UART_H_
- #define DEBUG_UART_H_
- #include "util.h"
- #include "fixpt.h"
- #include <stdint.h>
- #if CONF_DEBUG
- #define DEBUG_PREFIX1(prefix0) prefix0, NULL
- #define DEBUG_PREFIX2(prefix0, prefix1) prefix0, prefix1
- #define DEBUG_PFX1(prefix0) DEBUG_PREFIX1(PSTR(prefix0))
- #define DEBUG_PFX2(prefix0, prefix1) DEBUG_PREFIX2(PSTR(prefix0), PSTR(prefix1))
- void debug_print_int32(const char __flash *prefix0,
- const char __flash *prefix1,
- int32_t value);
- void debug_print_int24(const char __flash *prefix0,
- const char __flash *prefix1,
- int24_t value);
- void debug_print_int16(const char __flash *prefix0,
- const char __flash *prefix1,
- int16_t value);
- void debug_print_int8(const char __flash *prefix0,
- const char __flash *prefix1,
- int8_t value);
- void debug_print_fixpt(const char __flash *prefix0,
- const char __flash *prefix1,
- fixpt_t value);
- void debug_report_int32(const char __flash *prefix0,
- const char __flash *prefix1,
- int32_t *old_value,
- int32_t new_value);
- void debug_report_int24(const char __flash *prefix0,
- const char __flash *prefix1,
- int24_t *old_value,
- int24_t new_value);
- void debug_report_int16(const char __flash *prefix0,
- const char __flash *prefix1,
- int16_t *old_value,
- int16_t new_value);
- void debug_report_int8(const char __flash *prefix0,
- const char __flash *prefix1,
- int8_t *old_value,
- int8_t new_value);
- void debug_report_fixpt(const char __flash *prefix0,
- const char __flash *prefix1,
- fixpt_t *old_value,
- fixpt_t new_value);
- void debug_enable(bool enable);
- bool debug_is_enabled(void);
- void debug_uart_init(void);
- #else /* CONF_DEBUG */
- #define DEBUG_PREFIX1(prefix0) NULL, NULL
- #define DEBUG_PREFIX2(prefix0, prefix1) NULL, NULL
- #define DEBUG_PFX1(prefix0) DEBUG_PREFIX1(NULL)
- #define DEBUG_PFX2(prefix0, prefix1) DEBUG_PREFIX2(NULL, NULL)
- static inline
- void debug_print_int32(const char __flash *prefix0,
- const char __flash *prefix1,
- int32_t value)
- {
- }
- static inline
- void debug_print_int24(const char __flash *prefix0,
- const char __flash *prefix1,
- int24_t value)
- {
- }
- static inline
- void debug_print_int16(const char __flash *prefix0,
- const char __flash *prefix1,
- int16_t value)
- {
- }
- static inline
- void debug_print_int8(const char __flash *prefix0,
- const char __flash *prefix1,
- int8_t value)
- {
- }
- static inline
- void debug_print_fixpt(const char __flash *prefix0,
- const char __flash *prefix1,
- fixpt_t value)
- {
- }
- static inline
- void debug_report_int32(const char __flash *prefix0,
- const char __flash *prefix1,
- int32_t *old_value,
- int32_t new_value)
- {
- }
- static inline
- void debug_report_int24(const char __flash *prefix0,
- const char __flash *prefix1,
- int24_t *old_value,
- int24_t new_value)
- {
- }
- static inline
- void debug_report_int16(const char __flash *prefix0,
- const char __flash *prefix1,
- int16_t *old_value,
- int16_t new_value)
- {
- }
- static inline
- void debug_report_int8(const char __flash *prefix0,
- const char __flash *prefix1,
- int8_t *old_value,
- int8_t new_value)
- {
- }
- static inline
- void debug_report_fixpt(const char __flash *prefix0,
- const char __flash *prefix1,
- fixpt_t *old_value,
- fixpt_t new_value)
- {
- }
- static inline
- void debug_enable(bool enable)
- {
- }
- static inline
- bool debug_is_enabled(void)
- {
- return false;
- }
- static inline
- void debug_uart_init(void)
- {
- }
- #endif /* CONF_DEBUG */
- #endif /* DEBUG_UART_H_ */
|