35 #define U16_CHARSEQ(val) val, 0,
37 #define U16_CHARS1(val) U16_CHARSEQ(val)
38 #define U16_CHARS2(val, ...) U16_CHARSEQ(val) U16_CHARS1(__VA_ARGS__)
39 #define U16_CHARS3(val, ...) U16_CHARSEQ(val) U16_CHARS2(__VA_ARGS__)
40 #define U16_CHARS4(val, ...) U16_CHARSEQ(val) U16_CHARS3(__VA_ARGS__)
41 #define U16_CHARS5(val, ...) U16_CHARSEQ(val) U16_CHARS4(__VA_ARGS__)
42 #define U16_CHARS6(val, ...) U16_CHARSEQ(val) U16_CHARS5(__VA_ARGS__)
43 #define U16_CHARS7(val, ...) U16_CHARSEQ(val) U16_CHARS6(__VA_ARGS__)
44 #define U16_CHARS8(val, ...) U16_CHARSEQ(val) U16_CHARS7(__VA_ARGS__)
45 #define U16_CHARS9(val, ...) U16_CHARSEQ(val) U16_CHARS8(__VA_ARGS__)
46 #define U16_CHARS10(val, ...) U16_CHARSEQ(val) U16_CHARS9(__VA_ARGS__)
47 #define U16_CHARS11(val, ...) U16_CHARSEQ(val) U16_CHARS10(__VA_ARGS__)
48 #define U16_CHARS12(val, ...) U16_CHARSEQ(val) U16_CHARS11(__VA_ARGS__)
49 #define U16_CHARS13(val, ...) U16_CHARSEQ(val) U16_CHARS12(__VA_ARGS__)
50 #define U16_CHARS14(val, ...) U16_CHARSEQ(val) U16_CHARS13(__VA_ARGS__)
51 #define U16_CHARS15(val, ...) U16_CHARSEQ(val) U16_CHARS14(__VA_ARGS__)
52 #define U16_CHARS16(val, ...) U16_CHARSEQ(val) U16_CHARS15(__VA_ARGS__)
53 #define U16_CHARS17(val, ...) U16_CHARSEQ(val) U16_CHARS16(__VA_ARGS__)
55 #define GENERATE_USB_STRING_IMPL(name, n, ...) static const uint8_t name[n*2+2] = { n*2+2, USB_DESC_TYPE_STRING, U16_CHARS##n(__VA_ARGS__) }
56 #define GENERATE_USB_STRING(name, n, v) GENERATE_USB_STRING_IMPL(name, n, v)
#define GENERATE_USB_STRING(name, n, v)
static uint8_t usb_serial_number[2+PIOS_SYS_SERIAL_NUM_ASCII_LEN *2+(sizeof(PIOS_USB_BOARD_SN_SUFFIX)-1)*2]
APIs for PIOS_USBHOOK layer.
#define PIOS_SYS_SERIAL_NUM_ASCII_LEN
int32_t PIOS_USB_BOARD_DATA_Init(void)
void PIOS_USBHOOK_RegisterString(enum usb_string_desc string_id, const uint8_t *desc, uint16_t desc_size)
static const struct usb_string_langid usb_lang_id
int32_t PIOS_SYS_SerialNumberGet(char str[PIOS_SYS_SERIAL_NUM_ASCII_LEN+1])
uint8_t * PIOS_USB_UTIL_AsciiToUtf8(uint8_t *dst, uint8_t *src, uint16_t srclen)
#define PIOS_USB_BOARD_SN_SUFFIX
#define USB_LANGID_ENGLISH_US