|
|
@ -11,12 +11,20 @@ |
|
|
|
|
|
|
|
|
|
|
|
#if USE_DEBUG_UART |
|
|
|
#if USE_DEBUG_UART |
|
|
|
|
|
|
|
|
|
|
|
int PRINTF(const char *format, ...) __attribute__((format(printf,1,2))) ; |
|
|
|
int _DO_PRINTF(const char *format, ...) __attribute__((format(printf,1,2))) ; |
|
|
|
void PUTSN(const char *string, size_t len); |
|
|
|
void PUTSN(const char *string, size_t len); |
|
|
|
int PUTS(const char *string); |
|
|
|
int PUTS(const char *string); |
|
|
|
void PUTNL(void); |
|
|
|
void PUTNL(void); |
|
|
|
int PUTCHAR(int ch); |
|
|
|
int PUTCHAR(int ch); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define PRINTF(format, ...) do { \ |
|
|
|
|
|
|
|
if (VA_ARG_COUNT(__VA_ARGS__) == 0) { \
|
|
|
|
|
|
|
|
PUTS(format); \
|
|
|
|
|
|
|
|
} else { \
|
|
|
|
|
|
|
|
_DO_PRINTF(format, ##__VA_ARGS__); \
|
|
|
|
|
|
|
|
} \
|
|
|
|
|
|
|
|
} while (0) |
|
|
|
|
|
|
|
|
|
|
|
#define dbg(format, ...) do { \ |
|
|
|
#define dbg(format, ...) do { \ |
|
|
|
if (VA_ARG_COUNT(__VA_ARGS__) == 0) { \
|
|
|
|
if (VA_ARG_COUNT(__VA_ARGS__) == 0) { \
|
|
|
|
PUTS(format); \
|
|
|
|
PUTS(format); \
|
|
|
|