summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChang Feng <[email protected]>2020-07-19 19:13:17 +0800
committerChang Feng <[email protected]>2020-07-19 19:13:17 +0800
commit5cd654838ba590ab49b637ead744cc0bae671946 (patch)
treed41f24afc98b333b87ccf8634b151157c3da1b4b /src
parent2274740e48a73e1888657ed6d505db19a6c252e1 (diff)
Remove 0xEE index string if statement & change TU_ASSERT to TU_VERIFY
Signed-off-by: Chang Feng <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/device/usbd.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index b607f5939..afd46b8ce 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -886,20 +886,11 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
TU_LOG2(" String[%u]\r\n", desc_index);
// String Descriptor always uses the desc set from user
- if ( desc_index == 0xEE )
- {
- // The 0xEE index string is a Microsoft OS Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
- return false;
- }
- else
- {
- uint8_t const* desc_str = (uint8_t const*) tud_descriptor_string_cb(desc_index, p_request->wIndex);
- TU_ASSERT(desc_str);
+ uint8_t const* desc_str = (uint8_t const*) tud_descriptor_string_cb(desc_index, p_request->wIndex);
+ TU_VERIFY(desc_str);
- // first byte of descriptor is its size
- return tud_control_xfer(rhport, p_request, (void*) desc_str, desc_str[0]);
- }
+ // first byte of descriptor is its size
+ return tud_control_xfer(rhport, p_request, (void*) desc_str, desc_str[0]);
break;
case TUSB_DESC_DEVICE_QUALIFIER: