summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_debug.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/tusb_debug.h b/src/common/tusb_debug.h
index 470a8a18b..ba5b4afd1 100644
--- a/src/common/tusb_debug.h
+++ b/src/common/tusb_debug.h
@@ -117,7 +117,16 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3
}
}
+ #ifndef CFG_TUSB_DEBUG_PRINTF
+ // not found return the key value in hex if no custom printf is defined
+ static char not_found[11];
+ if (snprintf(not_found, sizeof(not_found), "0x%08lX", (unsigned long)key) <= 0) {
+ not_found[0] = 0;
+ }
+ return not_found;
+ #else
return "NotFound";
+ #endif
}
#endif // CFG_TUSB_DEBUG