remove ep descriptor wMaxPacketSize bitfield due to endian issue
This commit is contained in:
@@ -393,18 +393,17 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
|
||||
uint8_t const epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
|
||||
uint8_t const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
|
||||
|
||||
TU_ASSERT(p_endpoint_desc->wMaxPacketSize.size <= 64);
|
||||
TU_ASSERT(epnum < EP_COUNT);
|
||||
TU_ASSERT(epnum != 0);
|
||||
|
||||
xfer_ctl_t *xfer = XFER_CTL_BASE(epnum, dir);
|
||||
xfer->max_size = p_endpoint_desc->wMaxPacketSize.size;
|
||||
xfer->max_size = tu_edpt_packet_size(p_endpoint_desc);
|
||||
|
||||
if(dir == TUSB_DIR_OUT)
|
||||
{
|
||||
USB->DOEP[epnum - 1].CTL |= USB_DOEP_CTL_USBACTEP |
|
||||
(p_endpoint_desc->bmAttributes.xfer << _USB_DOEP_CTL_EPTYPE_SHIFT) |
|
||||
(p_endpoint_desc->wMaxPacketSize.size << _USB_DOEP_CTL_MPS_SHIFT);
|
||||
(xfer->max_size << _USB_DOEP_CTL_MPS_SHIFT);
|
||||
USB->DAINTMSK |= (1 << (_USB_DAINTMSK_OUTEPMSK0_SHIFT + epnum));
|
||||
}
|
||||
else
|
||||
@@ -417,7 +416,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
|
||||
(fifo_num << _USB_DIEP_CTL_TXFNUM_SHIFT) |
|
||||
(p_endpoint_desc->bmAttributes.xfer << _USB_DIEP_CTL_EPTYPE_SHIFT) |
|
||||
((p_endpoint_desc->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS) ? USB_DIEP_CTL_SETD0PIDEF : 0) |
|
||||
(p_endpoint_desc->wMaxPacketSize.size << 0);
|
||||
(xfer->max_size << 0);
|
||||
|
||||
USB->DAINTMSK |= (1 << epnum);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user