diff options
| author | sakumisu <[email protected]> | 2022-04-03 22:11:02 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2022-04-03 22:11:08 +0800 |
| commit | f716b6d307eca556acdc0fc5dad24b57c2fd5109 (patch) | |
| tree | 49ec1c394556788da0aae24fad127a4ca70e863a /common | |
| parent | 44c282580d2ce4fd71e706a762e4323973010312 (diff) | |
add USB_LOG_RAW macro for printf
Diffstat (limited to 'common')
| -rw-r--r-- | common/usb_util.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/common/usb_util.h b/common/usb_util.h index 7c70c1f1..30415de4 100644 --- a/common/usb_util.h +++ b/common/usb_util.h @@ -274,16 +274,17 @@ * CYAN 36 * WHITE 37 */ -#define _USB_DBG_COLOR(n) printf("\033[" #n "m") +#define _USB_PRINTF printf +#define _USB_DBG_COLOR(n) _USB_PRINTF("\033[" #n "m") #define _USB_DBG_LOG_HDR(lvl_name, color_n) \ - printf("\033[" #color_n "m[" lvl_name "/" USB_DBG_TAG "] ") + _USB_PRINTF("\033[" #color_n "m[" lvl_name "/" USB_DBG_TAG "] ") #define _USB_DBG_LOG_X_END \ - printf("\033[0m") + _USB_PRINTF("\033[0m") #define usb_dbg_log_line(lvl, color_n, fmt, ...) \ do { \ _USB_DBG_LOG_HDR(lvl, color_n); \ - printf(fmt, ##__VA_ARGS__); \ + _USB_PRINTF(fmt, ##__VA_ARGS__); \ _USB_DBG_LOG_X_END; \ } while (0) @@ -311,6 +312,8 @@ #define USB_LOG_ERR(...) #endif +#define USB_LOG_RAW _USB_PRINTF + void usb_assert(const char *filename, int linenum); #define USB_ASSERT(f) \ do { \ |
