summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-04-18 15:24:42 +0700
committerGitHub <[email protected]>2025-04-18 15:24:42 +0700
commit3fd7854a91f82b683af7a6442f8447f02ab5a29c (patch)
tree3a2c716f7669cbb310eb9935d83414e680e58ed0 /src/common
parentedbea218b92fe20215e9fc0cfd69208babc08259 (diff)
parentba45625ea4fe57625059b90e5d2c0f4602818737 (diff)
Merge pull request #3081 from hathach/usbh-enum-get-string-desc-first
usbh enum get string descriptor length first
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_debug.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/common/tusb_debug.h b/src/common/tusb_debug.h
index 2e9f1d9cd..1d0c6f1ad 100644
--- a/src/common/tusb_debug.h
+++ b/src/common/tusb_debug.h
@@ -108,15 +108,13 @@ typedef struct {
} tu_lookup_table_t;
static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint32_t key) {
- tu_static char not_found[11];
-
for(uint16_t i=0; i<p_table->count; i++) {
- if (p_table->items[i].key == key) return p_table->items[i].data;
+ if (p_table->items[i].key == key) { return p_table->items[i].data; }
}
// not found return the key value in hex
+ static char not_found[11];
snprintf(not_found, sizeof(not_found), "0x%08lX", (unsigned long) key);
-
return not_found;
}