diff --git a/examples/device/cdc_dual_ports/src/usb_descriptors.c b/examples/device/cdc_dual_ports/src/usb_descriptors.c index f23e42036..8e19678e5 100644 --- a/examples/device/cdc_dual_ports/src/usb_descriptors.c +++ b/examples/device/cdc_dual_ports/src/usb_descriptors.c @@ -170,7 +170,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) chr_count = 1; }else { - // Convert ASCII string into UTF-16 + // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors. + // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL; @@ -180,6 +181,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) chr_count = strlen(str); if ( chr_count > 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i (TU_ARRAY_SIZE(_desc_str) - 1)) chr_count = TU_ARRAY_SIZE(_desc_str) - 1; + // Convert ASCII string into UTF-16 for (unsigned int i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i