diff options
| author | HiFiPhile <[email protected]> | 2025-11-11 14:11:20 +0100 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2025-11-11 14:11:20 +0100 |
| commit | 2f0a35f21af4c09154d6b4b5b118325af8990e51 (patch) | |
| tree | b8cb51ecbe4610e2f762193b5ce311b25df97b2e /src/common/tusb_debug.h | |
| parent | 1ee47acd9070639043e4fc7ec132574f2922748c (diff) | |
| parent | 8a094e807b34bcc018c971d59acb660b1a9ddf9f (diff) | |
Merge remote-tracking branch 'tinyusb/master' into copilot/fix-dcd-edpt-xfer-issue
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/common/tusb_debug.h')
| -rw-r--r-- | src/common/tusb_debug.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/tusb_debug.h b/src/common/tusb_debug.h index e3f9d3f18..e0e09f5ce 100644 --- a/src/common/tusb_debug.h +++ b/src/common/tusb_debug.h @@ -55,7 +55,8 @@ void tu_print_mem(void const *buf, uint32_t count, uint8_t indent); extern int CFG_TUSB_DEBUG_PRINTF(const char *format, ...); #define tu_printf CFG_TUSB_DEBUG_PRINTF #else - #define tu_printf printf + #include <stdio.h> + #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) { @@ -118,7 +119,9 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3 // not found return the key value in hex static char not_found[11]; - snprintf(not_found, sizeof(not_found), "0x%08lX", (unsigned long) key); + if (snprintf(not_found, sizeof(not_found), "0x%08lX", (unsigned long) key) <= 0) { + not_found[0] = 0; + } return not_found; } |
