diff options
| author | hathach <[email protected]> | 2013-05-25 17:19:18 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-05-25 17:19:18 +0700 |
| commit | ed217948b8a25a7c4b7929775079ea8b9086305b (patch) | |
| tree | f615c3755c7e2c681f8f2669bb3c1458911626c6 /tinyusb | |
| parent | ae02263d817a7b2f37c7e9c5026fd067b9d75fcc (diff) | |
rename descriptor type, hid descriptor type
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/class/hid.h | 6 | ||||
| -rw-r--r-- | tinyusb/class/hid_host.c | 4 | ||||
| -rw-r--r-- | tinyusb/core/tusb_types.h | 22 | ||||
| -rw-r--r-- | tinyusb/host/usbh.c | 10 |
4 files changed, 21 insertions, 21 deletions
diff --git a/tinyusb/class/hid.h b/tinyusb/class/hid.h index 2e876c8d8..5cf9a4907 100644 --- a/tinyusb/class/hid.h +++ b/tinyusb/class/hid.h @@ -64,9 +64,9 @@ //}; enum { - HID_DESC_HID = 0x21, - HID_DESC_REPORT = 0x22, - HID_DESC_PHYSICAL = 0x23 + HID_DESC_TYPE_HID = 0x21, + HID_DESC_TYPE_REPORT = 0x22, + HID_DESC_TYPE_PHYSICAL = 0x23 }; typedef ATTR_PREPACKED struct ATTR_PACKED { diff --git a/tinyusb/class/hid_host.c b/tinyusb/class/hid_host.c index 296d26ee0..0cced3226 100644 --- a/tinyusb/class/hid_host.c +++ b/tinyusb/class/hid_host.c @@ -205,14 +205,14 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con //------------- HID descriptor -------------// p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; tusb_hid_descriptor_hid_t const *p_desc_hid = (tusb_hid_descriptor_hid_t const *) p_desc; - ASSERT_INT(HID_DESC_HID, p_desc_hid->bDescriptorType, TUSB_ERROR_INVALID_PARA); + ASSERT_INT(HID_DESC_TYPE_HID, p_desc_hid->bDescriptorType, TUSB_ERROR_INVALID_PARA); //------------- TODO skip Get Report Descriptor -------------// uint8_t *p_report_desc = NULL; // report descriptor has to be global & in USB RAM //------------- Endpoint Descriptor -------------// p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; - ASSERT_INT(TUSB_DESC_ENDPOINT, p_desc[DESCRIPTOR_OFFSET_TYPE], TUSB_ERROR_INVALID_PARA); + ASSERT_INT(TUSB_DESC_TYPE_ENDPOINT, p_desc[DESCRIPTOR_OFFSET_TYPE], TUSB_ERROR_INVALID_PARA); if (p_interface_desc->bInterfaceSubClass == HID_SUBCLASS_BOOT) { diff --git a/tinyusb/core/tusb_types.h b/tinyusb/core/tusb_types.h index f2cd4f147..75705dbe3 100644 --- a/tinyusb/core/tusb_types.h +++ b/tinyusb/core/tusb_types.h @@ -76,17 +76,17 @@ typedef enum { /// USB Descriptor Types (section 9.4 table 9-5) typedef enum { - TUSB_DESC_DEVICE =1 , ///< 1 - TUSB_DESC_CONFIGURATION , ///< 2 - TUSB_DESC_STRING , ///< 3 - TUSB_DESC_INTERFACE , ///< 4 - TUSB_DESC_ENDPOINT , ///< 5 - TUSB_DESC_DEVICE_QUALIFIER , ///< 6 - TUSB_DESC_OTHER_SPEED_CONFIGURATION , ///< 7 - TUSB_DESC_INTERFACE_POWER , ///< 8 - TUSB_DESC_OTG , ///< 9 - TUSB_DESC_DEBUGRIPTOR , ///< 10 - TUSB_DESC_INTERFACE_ASSOCIATION ///< 11 + TUSB_DESC_TYPE_DEVICE =1 , ///< 1 + TUSB_DESC_TYPE_CONFIGURATION , ///< 2 + TUSB_DESC_TYPE_STRING , ///< 3 + TUSB_DESC_TYPE_INTERFACE , ///< 4 + TUSB_DESC_TYPE_ENDPOINT , ///< 5 + TUSB_DESC_TYPE_DEVICE_QUALIFIER , ///< 6 + TUSB_DESC_TYPE_OTHER_SPEED_CONFIGURATION , ///< 7 + TUSB_DESC_TYPE_INTERFACE_POWER , ///< 8 + TUSB_DESC_TYPE_OTG , ///< 9 + TUSB_DESC_TYPE_DEBUG , ///< 10 + TUSB_DESC_TYPE_INTERFACE_ASSOCIATION ///< 11 }tusb_std_descriptor_type_t; typedef enum { diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index c5f6ddeb2..3dc28e2b3 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -303,7 +303,7 @@ tusb_error_t enumeration_body_subtask(void) { .bmRequestType = { .direction = TUSB_DIR_DEV_TO_HOST, .type = TUSB_REQUEST_TYPE_STANDARD, .recipient = TUSB_REQUEST_RECIPIENT_DEVICE }, .bRequest = TUSB_REQUEST_GET_DESCRIPTOR, - .wValue = (TUSB_DESC_DEVICE << 8), + .wValue = (TUSB_DESC_TYPE_DEVICE << 8), .wLength = 8 }, enum_data_buffer ), @@ -352,7 +352,7 @@ tusb_error_t enumeration_body_subtask(void) { .bmRequestType = { .direction = TUSB_DIR_DEV_TO_HOST, .type = TUSB_REQUEST_TYPE_STANDARD, .recipient = TUSB_REQUEST_RECIPIENT_DEVICE }, .bRequest = TUSB_REQUEST_GET_DESCRIPTOR, - .wValue = (TUSB_DESC_DEVICE << 8), + .wValue = (TUSB_DESC_TYPE_DEVICE << 8), .wLength = 18 }, enum_data_buffer ), @@ -376,7 +376,7 @@ tusb_error_t enumeration_body_subtask(void) { .bmRequestType = { .direction = TUSB_DIR_DEV_TO_HOST, .type = TUSB_REQUEST_TYPE_STANDARD, .recipient = TUSB_REQUEST_RECIPIENT_DEVICE }, .bRequest = TUSB_REQUEST_GET_DESCRIPTOR, - .wValue = (TUSB_DESC_CONFIGURATION << 8) | (configure_selected - 1), + .wValue = (TUSB_DESC_TYPE_CONFIGURATION << 8) | (configure_selected - 1), .wLength = 9 }, enum_data_buffer ), @@ -394,7 +394,7 @@ tusb_error_t enumeration_body_subtask(void) { .bmRequestType = { .direction = TUSB_DIR_DEV_TO_HOST, .type = TUSB_REQUEST_TYPE_STANDARD, .recipient = TUSB_REQUEST_RECIPIENT_DEVICE }, .bRequest = TUSB_REQUEST_GET_DESCRIPTOR, - .wValue = (TUSB_DESC_CONFIGURATION << 8) | (configure_selected - 1), + .wValue = (TUSB_DESC_TYPE_CONFIGURATION << 8) | (configure_selected - 1), .wLength = ((tusb_descriptor_configuration_t*) enum_data_buffer)->wTotalLength }, enum_data_buffer ), @@ -429,7 +429,7 @@ tusb_error_t enumeration_body_subtask(void) while( p_desc < enum_data_buffer + ((tusb_descriptor_configuration_t*)enum_data_buffer)->wTotalLength ) { // skip until we see interface descriptor - if ( TUSB_DESC_INTERFACE != p_desc[DESCRIPTOR_OFFSET_TYPE] ) + if ( TUSB_DESC_TYPE_INTERFACE != p_desc[DESCRIPTOR_OFFSET_TYPE] ) { p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; // skip the descriptor, increase by the descriptor's length }else |
