From ec3227b2202b007da1b76c20394b6f4d774f68b6 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 3 Jul 2018 16:39:42 +0700 Subject: [PATCH] add TUD_DESC_STRCONV --- src/common/tusb_types.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h index b50cacb03..4b8ef899c 100644 --- a/src/common/tusb_types.h +++ b/src/common/tusb_types.h @@ -394,6 +394,10 @@ static inline uint8_t edpt_addr(uint8_t num, tusb_dir_t dir) return num | (dir == TUSB_DIR_IN ? TUSB_DIR_IN_MASK : 0); } + +// Convert comma-separated string to descriptor unicode format +#define TUD_DESC_STRCONV( ... ) (const uint16_t[]) { (TUSB_DESC_STRING << 8 ) | (2*VA_ARGS_NUM_(__VA_ARGS__) + 2), __VA_ARGS__ } + #ifdef __cplusplus } #endif