Skip to content

Commit

Permalink
FIX: use ep rx_size/tx_size in descriptors, use correct sizeof arg fo…
Browse files Browse the repository at this point in the history
…r data_eptx_x
  • Loading branch information
r2axz committed Jul 28, 2021
1 parent 256cfb4 commit abd6d51
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions usb_descriptors.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const usb_device_descriptor_t usb_device_descriptor = {
.bDeviceClass = usb_device_class_misc,
.bDeviceSubClass = usb_device_subclass_iad,
.bDeviceProtocol = usb_device_protocol_iad,
.bMaxPacketSize = USB_CONTROL_ENDPOINT_SIZE,
.bMaxPacketSize = usb_endpoints[usb_endpoint_address_control].rx_size,
.idVendor = USB_ID_VENDOR,
.idProduct = USB_ID_PRODUCT,
.bcdDevice = USB_BCD_VERSION(1, 0, 0),
Expand Down Expand Up @@ -159,7 +159,7 @@ const usb_device_configuration_descriptor_t usb_configuration_descriptor = {
.bDescriptorType = usb_descriptor_type_endpoint,
.bEndpointAddress = usb_endpoint_direction_in | usb_endpoint_address_cdc_0_interrupt,
.bmAttributes = usb_endpoint_type_interrupt,
.wMaxPacketSize = USB_CDC_INTERRUPT_ENDPOINT_SIZE,
.wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_0_interrupt].tx_size,
.bInterval = USB_CDC_INTERRUPT_ENDPOINT_POLLING_INTERVAL,
},
.data_0 = {
Expand All @@ -178,15 +178,15 @@ const usb_device_configuration_descriptor_t usb_configuration_descriptor = {
.bDescriptorType = usb_descriptor_type_endpoint,
.bEndpointAddress = usb_endpoint_direction_out | usb_endpoint_address_cdc_0_data,
.bmAttributes = usb_endpoint_type_bulk,
.wMaxPacketSize = USB_CDC_DATA_ENDPOINT_SIZE_SMALL,
.wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_0_data].rx_size,
.bInterval = 0,
},
.data_eptx_0 = {
.bLength = sizeof(usb_configuration_descriptor.data_eprx_0),
.bLength = sizeof(usb_configuration_descriptor.data_eptx_0),
.bDescriptorType = usb_descriptor_type_endpoint,
.bEndpointAddress = usb_endpoint_direction_in | usb_endpoint_address_cdc_0_data,
.bmAttributes = usb_endpoint_type_bulk,
.wMaxPacketSize = USB_CDC_DATA_ENDPOINT_SIZE_SMALL,
.wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_0_data].tx_size,
.bInterval = 0,
},
.comm_iad_1 = {
Expand Down Expand Up @@ -241,7 +241,7 @@ const usb_device_configuration_descriptor_t usb_configuration_descriptor = {
.bDescriptorType = usb_descriptor_type_endpoint,
.bEndpointAddress = usb_endpoint_direction_in | usb_endpoint_address_cdc_1_interrupt,
.bmAttributes = usb_endpoint_type_interrupt,
.wMaxPacketSize = USB_CDC_INTERRUPT_ENDPOINT_SIZE,
.wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_1_interrupt].tx_size,
.bInterval = USB_CDC_INTERRUPT_ENDPOINT_POLLING_INTERVAL,
},
.data_1 = {
Expand All @@ -260,15 +260,15 @@ const usb_device_configuration_descriptor_t usb_configuration_descriptor = {
.bDescriptorType = usb_descriptor_type_endpoint,
.bEndpointAddress = usb_endpoint_direction_out | usb_endpoint_address_cdc_1_data,
.bmAttributes = usb_endpoint_type_bulk,
.wMaxPacketSize = USB_CDC_DATA_ENDPOINT_SIZE_LARGE,
.wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_1_data].rx_size,
.bInterval = 0,
},
.data_eptx_1 = {
.bLength = sizeof(usb_configuration_descriptor.data_eprx_1),
.bLength = sizeof(usb_configuration_descriptor.data_eptx_1),
.bDescriptorType = usb_descriptor_type_endpoint,
.bEndpointAddress = usb_endpoint_direction_in | usb_endpoint_address_cdc_1_data,
.bmAttributes = usb_endpoint_type_bulk,
.wMaxPacketSize = USB_CDC_DATA_ENDPOINT_SIZE_LARGE,
.wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_1_data].tx_size,
.bInterval = 0,
},
.comm_iad_2 = {
Expand Down Expand Up @@ -323,7 +323,7 @@ const usb_device_configuration_descriptor_t usb_configuration_descriptor = {
.bDescriptorType = usb_descriptor_type_endpoint,
.bEndpointAddress = usb_endpoint_direction_in | usb_endpoint_address_cdc_2_interrupt,
.bmAttributes = usb_endpoint_type_interrupt,
.wMaxPacketSize = USB_CDC_INTERRUPT_ENDPOINT_SIZE,
.wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_0_interrupt].tx_size,
.bInterval = USB_CDC_INTERRUPT_ENDPOINT_POLLING_INTERVAL,
},
.data_2 = {
Expand All @@ -342,15 +342,15 @@ const usb_device_configuration_descriptor_t usb_configuration_descriptor = {
.bDescriptorType = usb_descriptor_type_endpoint,
.bEndpointAddress = usb_endpoint_direction_out | usb_endpoint_address_cdc_2_data,
.bmAttributes = usb_endpoint_type_bulk,
.wMaxPacketSize = USB_CDC_DATA_ENDPOINT_SIZE_LARGE,
.wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_2_data].rx_size,
.bInterval = 0,
},
.data_eptx_2 = {
.bLength = sizeof(usb_configuration_descriptor.data_eprx_2),
.bLength = sizeof(usb_configuration_descriptor.data_eptx_2),
.bDescriptorType = usb_descriptor_type_endpoint,
.bEndpointAddress = usb_endpoint_direction_in | usb_endpoint_address_cdc_2_data,
.bmAttributes = usb_endpoint_type_bulk,
.wMaxPacketSize = USB_CDC_DATA_ENDPOINT_SIZE_LARGE,
.wMaxPacketSize = usb_endpoints[usb_endpoint_address_cdc_2_data].tx_size,
.bInterval = 0,
},

Expand Down

0 comments on commit abd6d51

Please sign in to comment.