summaryrefslogtreecommitdiff
path: root/tinyusb/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-18 18:38:15 +0700
committerhathach <[email protected]>2014-03-18 18:38:15 +0700
commitcf82b13a0ef74dca1eebdad577a382af63c82fdc (patch)
tree9bbca57e52b767691c9499dc353927b4d00175b8 /tinyusb/device
parenteab4f9642c27749a3232f09857079a9c9ab7aeb9 (diff)
finish descriptor refractor for hid keyboard & mouse
Diffstat (limited to 'tinyusb/device')
-rw-r--r--tinyusb/device/usbd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c
index 3e780b390..a9ed82e2d 100644
--- a/tinyusb/device/usbd.c
+++ b/tinyusb/device/usbd.c
@@ -303,7 +303,7 @@ static tusb_error_t usbd_set_configure_received(uint8_t coreid, uint8_t config_n
{
if ( TUSB_DESC_TYPE_INTERFACE_ASSOCIATION == p_desc[DESCRIPTOR_OFFSET_TYPE])
{
- p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; // ignore IAD
+ p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; // ignore Interface Association
}else
{
ASSERT( TUSB_DESC_TYPE_INTERFACE == p_desc[DESCRIPTOR_OFFSET_TYPE], TUSB_ERROR_NOT_SUPPORTED_YET );
@@ -346,7 +346,7 @@ static tusb_error_t get_descriptor(uint8_t coreid, tusb_control_request_t const
}
else if ( TUSB_DESC_TYPE_STRING == desc_type )
{
- if ( ! (desc_index < TUSB_CFG_DEVICE_STRING_DESCRIPTOR_COUNT) ) return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT;
+ if ( !(desc_index < TUSB_CFG_DEVICE_STRING_DESCRIPTOR_COUNT && tusbd_descriptor_pointers.p_string_arr[desc_index] != NULL) ) return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT;
(*pp_buffer) = tusbd_descriptor_pointers.p_string_arr[desc_index];
(*p_length) = **pp_buffer;