remove ep descriptor wMaxPacketSize bitfield due to endian issue
This commit is contained in:
@@ -346,7 +346,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
|
||||
/* No support for control transfer */
|
||||
TU_ASSERT(epn && (xfer != TUSB_XFER_CONTROL));
|
||||
|
||||
ep->max_packet_size = ep_desc->wMaxPacketSize.size;
|
||||
ep->max_packet_size = tu_edpt_packet_size(ep_desc);
|
||||
unsigned val = USB_ENDPT_EPCTLDIS_MASK;
|
||||
val |= (xfer != TUSB_XFER_ISOCHRONOUS) ? USB_ENDPT_EPHSHK_MASK: 0;
|
||||
val |= dir ? USB_ENDPT_EPTXEN_MASK : USB_ENDPT_EPRXEN_MASK;
|
||||
|
||||
@@ -311,14 +311,15 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
|
||||
}
|
||||
|
||||
//------------- Realize Endpoint with Max Packet Size -------------//
|
||||
set_ep_size(ep_id, p_endpoint_desc->wMaxPacketSize.size);
|
||||
const uint16_t ep_size = tu_edpt_packet_size(p_endpoint_desc);
|
||||
set_ep_size(ep_id, ep_size);
|
||||
|
||||
//------------- first DD prepare -------------//
|
||||
dma_desc_t* const dd = &_dcd.dd[ep_id];
|
||||
tu_memclr(dd, sizeof(dma_desc_t));
|
||||
|
||||
dd->isochronous = (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS) ? 1 : 0;
|
||||
dd->max_packet_size = p_endpoint_desc->wMaxPacketSize.size;
|
||||
dd->max_packet_size = ep_size;
|
||||
dd->retired = 1; // invalid at first
|
||||
|
||||
sie_write(SIE_CMDCODE_ENDPOINT_SET_STATUS + ep_id, 1, 0); // clear all endpoint status
|
||||
|
||||
@@ -365,7 +365,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
|
||||
tu_memclr(p_qhd, sizeof(dcd_qhd_t));
|
||||
|
||||
p_qhd->zero_length_termination = 1;
|
||||
p_qhd->max_packet_size = p_endpoint_desc->wMaxPacketSize.size;
|
||||
p_qhd->max_packet_size = tu_edpt_packet_size(p_endpoint_desc);
|
||||
if (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS)
|
||||
{
|
||||
p_qhd->iso_mult = 1;
|
||||
|
||||
Reference in New Issue
Block a user