summaryrefslogtreecommitdiff
path: root/tinyusb/device/usbd.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-11-13 14:00:39 +0700
committerhathach <[email protected]>2013-11-13 14:00:39 +0700
commit7d84139bd4e69e0b4cb42fb638a7a6d52afe93de (patch)
tree66247225ca9ced6cf01b3e5135a53ab0625f307a /tinyusb/device/usbd.c
parent92d9c36dbcfd933f872c91ad061e2e5ab184b020 (diff)
fix potential issue with stall endpoints
NOTE: cannot able to STALL control OUT endpoints --> unsupported with data out request may got to an issue. clean up configure, add max string descriptor configure as windows sometimes ask for string @ index 238 !!!
Diffstat (limited to 'tinyusb/device/usbd.c')
-rw-r--r--tinyusb/device/usbd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c
index d3480b370..9d7d23c07 100644
--- a/tinyusb/device/usbd.c
+++ b/tinyusb/device/usbd.c
@@ -199,6 +199,8 @@ tusb_error_t std_get_descriptor(uint8_t coreid, tusb_control_request_t * p_reque
break;
case TUSB_DESC_TYPE_STRING:
+ if ( ! (desc_index < TUSB_CFG_DEVICE_STRING_DESCRIPTOR_COUNT) ) return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT;
+
dcd_pipe_control_xfer(coreid, TUSB_DIR_DEV_TO_HOST, desc_str_table[desc_index], desc_str_table[desc_index]->bLength);
break;