add note for MS OS 1.0 Descriptor at 0xEE

This commit is contained in:
hathach
2020-07-21 21:00:11 +07:00
parent 1e2c554919
commit 787c891702
13 changed files with 39 additions and 13 deletions

View File

@@ -200,7 +200,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
}
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;
@@ -210,6 +211,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
chr_count = strlen(str);
if ( chr_count > (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<chr_count; i++)
{
_desc_str[1+i] = str[i];