diff --git a/demos/device/keyboard/descriptors.c b/demos/device/keyboard/descriptors.c index 91b2a900..e17527f6 100644 --- a/demos/device/keyboard/descriptors.c +++ b/demos/device/keyboard/descriptors.c @@ -123,7 +123,7 @@ TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) tusb_descriptor_device_t const desc_device = { .bLength = sizeof(tusb_descriptor_device_t), - .bDescriptorType = TUSB_DESC_DEVICE, + .bDescriptorType = TUSB_DESC_TYPE_DEVICE, .bcdUSB = 0x0200, .bDeviceClass = 0x00, .bDeviceSubClass = 0x00, @@ -149,7 +149,7 @@ const app_configuration_desc_t desc_configuration = .configuration = { .bLength = sizeof(tusb_descriptor_configuration_t), - .bDescriptorType = TUSB_DESC_CONFIGURATION, + .bDescriptorType = TUSB_DESC_TYPE_CONFIGURATION, .wTotalLength = sizeof(app_configuration_desc_t) - 1, // exclude termination .bNumInterfaces = TOTAL_INTEFACES, @@ -165,7 +165,7 @@ const app_configuration_desc_t desc_configuration = .CDC_IAD = { .bLength = sizeof(tusb_descriptor_interface_association_t), - .bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE_ASSOCIATION, .bFirstInterface = 0, .bInterfaceCount = 2, @@ -184,7 +184,7 @@ const app_configuration_desc_t desc_configuration = .CDC_CCI_Interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = INTERFACE_INDEX_CDC, .bAlternateSetting = 0, .bNumEndpoints = 1, @@ -225,7 +225,7 @@ const app_configuration_desc_t desc_configuration = .CDC_NotificationEndpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = CDC_NOTIFICATION_EP, .bmAttributes = USB_ENDPOINT_TYPE_INTERRUPT, .wMaxPacketSize = CDC_NOTIFICATION_EP_MAXPACKETSIZE, @@ -236,7 +236,7 @@ const app_configuration_desc_t desc_configuration = .CDC_DCI_Interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = INTERFACE_INDEX_CDC+1, .bAlternateSetting = 0x00, .bNumEndpoints = 2, @@ -249,7 +249,7 @@ const app_configuration_desc_t desc_configuration = .CDC_DataOutEndpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = CDC_DATA_EP_OUT, .bmAttributes = USB_ENDPOINT_TYPE_BULK, .wMaxPacketSize = CDC_DATA_EP_MAXPACKET_SIZE, @@ -259,7 +259,7 @@ const app_configuration_desc_t desc_configuration = .CDC_DataInEndpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = CDC_DATA_EP_IN, .bmAttributes = USB_ENDPOINT_TYPE_BULK, .wMaxPacketSize = CDC_DATA_EP_MAXPACKET_SIZE, @@ -272,7 +272,7 @@ const app_configuration_desc_t desc_configuration = .keyboard_interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = 1, .bAlternateSetting = 0x00, .bNumEndpoints = 1, @@ -285,18 +285,18 @@ const app_configuration_desc_t desc_configuration = .keyboard_hid = { .bLength = sizeof(tusb_hid_descriptor_hid_t), - .bDescriptorType = HID_DESC_HID, + .bDescriptorType = HID_DESC_TYPE_HID, .bcdHID = 0x0111, .bCountryCode = HID_Local_NotSupported, .bNumDescriptors = 1, - .bReportType = HID_DESC_REPORT, + .bReportType = HID_DESC_TYPE_REPORT, .wReportLength = sizeof(keyboard_report_descriptor) }, .keyboard_endpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x81, .bmAttributes = { .xfer = TUSB_XFER_INTERRUPT }, .wMaxPacketSize = { .size = 0x08 }, @@ -309,7 +309,7 @@ const app_configuration_desc_t desc_configuration = .HID_MouseInterface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = INTERFACE_INDEX_HID_MOUSE, .bAlternateSetting = 0x00, .bNumEndpoints = 1, @@ -322,18 +322,18 @@ const app_configuration_desc_t desc_configuration = .mouse_hid = { .bLength = sizeof(tusb_hid_descriptor_hid_t), - .bDescriptorType = HID_DESC_HID, + .bDescriptorType = HID_DESC_TYPE_HID, .bcdHID = 0x0111, .bCountryCode = HID_Local_NotSupported, .bNumDescriptors = 1, - .bReportType = HID_DESC_REPORT, + .bReportType = HID_DESC_TYPE_REPORT, .wReportLength = sizeof(mouse_report_descriptor) }, .mouse_endpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x82, .bmAttributes = { .xfer = TUSB_XFER_INTERRUPT }, .wMaxPacketSize = 0x08, @@ -346,7 +346,7 @@ const app_configuration_desc_t desc_configuration = .msc_interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = 3, .bAlternateSetting = 0x00, .bNumEndpoints = 2, @@ -359,7 +359,7 @@ const app_configuration_desc_t desc_configuration = .msc_endpoint_in = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x83, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, @@ -369,7 +369,7 @@ const app_configuration_desc_t desc_configuration = .msc_endpoint_out = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x03, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, diff --git a/demos/device/keyboard/main.c b/demos/device/keyboard/main.c index 324c6a51..0648b1e1 100644 --- a/demos/device/keyboard/main.c +++ b/demos/device/keyboard/main.c @@ -25,10 +25,12 @@ int main(void) { if (current_tick + 1000 < system_ticks) { - current_tick += 1000; - board_leds(0x01, (current_tick/1000)%2); /* Toggle LED once per second */ + static uint32_t led_on_mask = 0; - printf("tinyusb: " __DATE__ "\t" __TIME__ "\n"); + current_tick += 1000; + + board_leds(led_on_mask, 1 - led_on_mask); + led_on_mask = 1 - led_on_mask; // toggle #if !(defined TUSB_CFG_DEVICE_CDC) && 0 if (usb_isConfigured()) diff --git a/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c b/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c index 44cea9ab..cf566948 100644 --- a/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c +++ b/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c @@ -152,7 +152,7 @@ void test_bulk_pipe_close(void) tusb_descriptor_endpoint_t const desc_ept_bulk_in = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x81, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, diff --git a/tests/test/host/ehci/test_pipe_bulk_open.c b/tests/test/host/ehci/test_pipe_bulk_open.c index 75eb1657..4ddc519a 100644 --- a/tests/test/host/ehci/test_pipe_bulk_open.c +++ b/tests/test/host/ehci/test_pipe_bulk_open.c @@ -110,7 +110,7 @@ void verify_open_qhd(ehci_qhd_t *p_qhd, uint8_t endpoint_addr, uint16_t max_pack tusb_descriptor_endpoint_t const desc_ept_bulk_in = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x81, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, diff --git a/tests/test/host/ehci/test_pipe_bulk_xfer.c b/tests/test/host/ehci/test_pipe_bulk_xfer.c index e92544cd..ccf30d72 100644 --- a/tests/test/host/ehci/test_pipe_bulk_xfer.c +++ b/tests/test/host/ehci/test_pipe_bulk_xfer.c @@ -67,7 +67,7 @@ static pipe_handle_t pipe_hdl_bulk; tusb_descriptor_endpoint_t const desc_ept_bulk_in = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x81, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, @@ -77,7 +77,7 @@ tusb_descriptor_endpoint_t const desc_ept_bulk_in = tusb_descriptor_endpoint_t const desc_ept_bulk_out = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x01, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, diff --git a/tests/test/host/ehci/test_pipe_control_xfer.c b/tests/test/host/ehci/test_pipe_control_xfer.c index 605fd910..266cf0ef 100644 --- a/tests/test/host/ehci/test_pipe_control_xfer.c +++ b/tests/test/host/ehci/test_pipe_control_xfer.c @@ -107,7 +107,7 @@ tusb_std_request_t request_get_dev_desc = { .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 }; diff --git a/tests/test/host/ehci/test_pipe_interrupt_open.c b/tests/test/host/ehci/test_pipe_interrupt_open.c index 172ac6f4..946d8f0c 100644 --- a/tests/test/host/ehci/test_pipe_interrupt_open.c +++ b/tests/test/host/ehci/test_pipe_interrupt_open.c @@ -116,7 +116,7 @@ void verify_open_qhd(ehci_qhd_t *p_qhd, uint8_t endpoint_addr, uint16_t max_pack tusb_descriptor_endpoint_t const desc_ept_interrupt_out = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x02, .bmAttributes = { .xfer = TUSB_XFER_INTERRUPT }, .wMaxPacketSize = 16, diff --git a/tests/test/host/ehci/test_pipe_interrupt_xfer.c b/tests/test/host/ehci/test_pipe_interrupt_xfer.c index 1abb00e2..f72b5d3a 100644 --- a/tests/test/host/ehci/test_pipe_interrupt_xfer.c +++ b/tests/test/host/ehci/test_pipe_interrupt_xfer.c @@ -67,7 +67,7 @@ static pipe_handle_t pipe_hdl_interrupt; static tusb_descriptor_endpoint_t const desc_ept_interrupt_in = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x81, .bmAttributes = { .xfer = TUSB_XFER_INTERRUPT }, .wMaxPacketSize = 8, @@ -77,7 +77,7 @@ static tusb_descriptor_endpoint_t const desc_ept_interrupt_in = static tusb_descriptor_endpoint_t const desc_ept_interupt_out = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x01, .bmAttributes = { .xfer = TUSB_XFER_INTERRUPT }, .wMaxPacketSize = 64, diff --git a/tests/test/host/ehci/test_pipe_isochronous_open.c b/tests/test/host/ehci/test_pipe_isochronous_open.c index be1b7dfb..b2ebbf94 100644 --- a/tests/test/host/ehci/test_pipe_isochronous_open.c +++ b/tests/test/host/ehci/test_pipe_isochronous_open.c @@ -85,7 +85,7 @@ void tearDown(void) tusb_descriptor_endpoint_t const desc_ept_iso_in = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x83, .bmAttributes = { .xfer = TUSB_XFER_ISOCHRONOUS }, .wMaxPacketSize = 1024, diff --git a/tests/test/support/descriptor_test.c b/tests/test/support/descriptor_test.c index 59f07fce..a972da03 100644 --- a/tests/test/support/descriptor_test.c +++ b/tests/test/support/descriptor_test.c @@ -122,7 +122,7 @@ TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) tusb_descriptor_device_t const desc_device = { .bLength = sizeof(tusb_descriptor_device_t), - .bDescriptorType = TUSB_DESC_DEVICE, + .bDescriptorType = TUSB_DESC_TYPE_DEVICE, .bcdUSB = 0x0200, .bDeviceClass = 0x00, .bDeviceSubClass = 0x00, @@ -148,7 +148,7 @@ const app_configuration_desc_t desc_configuration = .configuration = { .bLength = sizeof(tusb_descriptor_configuration_t), - .bDescriptorType = TUSB_DESC_CONFIGURATION, + .bDescriptorType = TUSB_DESC_TYPE_CONFIGURATION, .wTotalLength = sizeof(app_configuration_desc_t) - 1, // exclude termination .bNumInterfaces = 1, @@ -163,7 +163,7 @@ const app_configuration_desc_t desc_configuration = .keyboard_interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = 1, .bAlternateSetting = 0x00, .bNumEndpoints = 1, @@ -176,18 +176,18 @@ const app_configuration_desc_t desc_configuration = .keyboard_hid = { .bLength = sizeof(tusb_hid_descriptor_hid_t), - .bDescriptorType = HID_DESC_HID, + .bDescriptorType = HID_DESC_TYPE_HID, .bcdHID = 0x0111, .bCountryCode = HID_Local_NotSupported, .bNumDescriptors = 1, - .bReportType = HID_DESC_REPORT, + .bReportType = HID_DESC_TYPE_REPORT, .wReportLength = sizeof(keyboard_report_descriptor) }, .keyboard_endpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x81, .bmAttributes = { .xfer = TUSB_XFER_INTERRUPT }, .wMaxPacketSize = 0x08, @@ -198,7 +198,7 @@ const app_configuration_desc_t desc_configuration = .mouse_interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = 2, .bAlternateSetting = 0x00, .bNumEndpoints = 1, @@ -211,18 +211,18 @@ const app_configuration_desc_t desc_configuration = .mouse_hid = { .bLength = sizeof(tusb_hid_descriptor_hid_t), - .bDescriptorType = HID_DESC_HID, + .bDescriptorType = HID_DESC_TYPE_HID, .bcdHID = 0x0111, .bCountryCode = HID_Local_NotSupported, .bNumDescriptors = 1, - .bReportType = HID_DESC_REPORT, + .bReportType = HID_DESC_TYPE_REPORT, .wReportLength = sizeof(mouse_report_descriptor) }, .mouse_endpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x82, .bmAttributes = { .xfer = TUSB_XFER_INTERRUPT }, .wMaxPacketSize = 0x08, @@ -233,7 +233,7 @@ const app_configuration_desc_t desc_configuration = .msc_interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = 3, .bAlternateSetting = 0x00, .bNumEndpoints = 2, @@ -246,7 +246,7 @@ const app_configuration_desc_t desc_configuration = .msc_endpoint_in = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x83, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, @@ -256,7 +256,7 @@ const app_configuration_desc_t desc_configuration = .msc_endpoint_out = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x03, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, diff --git a/tinyusb/class/hid.h b/tinyusb/class/hid.h index 2e876c8d..5cf9a490 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 296d26ee..0cced322 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 f2cd4f14..75705dbe 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 c5f6ddeb..3dc28e2b 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