diff options
| author | hathach <[email protected]> | 2025-11-08 15:54:02 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-11-08 15:54:02 +0700 |
| commit | 7f173ab5ed6a80a5fd6780779fe63fb97d2be0e9 (patch) | |
| tree | a8e3a74d5e2eeb1b43da42b6b23e597dda63cbe6 /src/common/tusb_debug.h | |
| parent | b83b36b35438bd80f743945ef58f8189b1f701e0 (diff) | |
fix more alerts
Diffstat (limited to 'src/common/tusb_debug.h')
| -rw-r--r-- | src/common/tusb_debug.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/tusb_debug.h b/src/common/tusb_debug.h index 08117283f..e0e09f5ce 100644 --- a/src/common/tusb_debug.h +++ b/src/common/tusb_debug.h @@ -56,14 +56,14 @@ void tu_print_mem(void const *buf, uint32_t count, uint8_t indent); #define tu_printf CFG_TUSB_DEBUG_PRINTF #else #include <stdio.h> - #define tu_printf printf + #define tu_printf(...) (void) printf(__VA_ARGS__) #endif TU_ATTR_ALWAYS_INLINE static inline void tu_print_buf(uint8_t const* buf, uint32_t bufsize) { for(uint32_t i=0; i<bufsize; i++) { - (void) tu_printf("%02X ", buf[i]); + tu_printf("%02X ", buf[i]); } - (void) tu_printf("\r\n"); + tu_printf("\r\n"); } // Log with Level @@ -72,15 +72,15 @@ TU_ATTR_ALWAYS_INLINE static inline void tu_print_buf(uint8_t const* buf, uint32 #define TU_LOG_BUF(n, ...) TU_XSTRCAT3(TU_LOG, n, _BUF)(__VA_ARGS__) #define TU_LOG_INT(n, ...) TU_XSTRCAT3(TU_LOG, n, _INT)(__VA_ARGS__) #define TU_LOG_HEX(n, ...) TU_XSTRCAT3(TU_LOG, n, _HEX)(__VA_ARGS__) -#define TU_LOG_LOCATION() (void) tu_printf("%s: %d:\r\n", __PRETTY_FUNCTION__, __LINE__) -#define TU_LOG_FAILED() (void) tu_printf("%s: %d: Failed\r\n", __PRETTY_FUNCTION__, __LINE__) +#define TU_LOG_LOCATION() tu_printf("%s: %d:\r\n", __PRETTY_FUNCTION__, __LINE__) +#define TU_LOG_FAILED() tu_printf("%s: %d: Failed\r\n", __PRETTY_FUNCTION__, __LINE__) // Log Level 1: Error -#define TU_LOG1(...) (void) tu_printf(__VA_ARGS__) +#define TU_LOG1 tu_printf #define TU_LOG1_MEM tu_print_mem #define TU_LOG1_BUF(_x, _n) tu_print_buf((uint8_t const*)(_x), _n) -#define TU_LOG1_INT(_x) (void) tu_printf(#_x " = %ld\r\n", (unsigned long) (_x) ) -#define TU_LOG1_HEX(_x) (void) tu_printf(#_x " = 0x%lX\r\n", (unsigned long) (_x) ) +#define TU_LOG1_INT(_x) tu_printf(#_x " = %ld\r\n", (unsigned long) (_x) ) +#define TU_LOG1_HEX(_x) tu_printf(#_x " = 0x%lX\r\n", (unsigned long) (_x) ) // Log Level 2: Warn #if CFG_TUSB_DEBUG >= 2 |
