|
@@ -394,7 +394,7 @@ static const tusb_desc_endpoint_t ep0OUT_desc =
|
|
|
|
|
|
|
|
.bEndpointAddress = 0x00,
|
|
.bEndpointAddress = 0x00,
|
|
|
.bmAttributes = { .xfer = TUSB_XFER_CONTROL },
|
|
.bmAttributes = { .xfer = TUSB_XFER_CONTROL },
|
|
|
- .wMaxPacketSize = { .size = CFG_TUD_ENDPOINT0_SIZE },
|
|
|
|
|
|
|
+ .wMaxPacketSize = CFG_TUD_ENDPOINT0_SIZE,
|
|
|
.bInterval = 0
|
|
.bInterval = 0
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -405,7 +405,7 @@ static const tusb_desc_endpoint_t ep0IN_desc =
|
|
|
|
|
|
|
|
.bEndpointAddress = 0x80,
|
|
.bEndpointAddress = 0x80,
|
|
|
.bmAttributes = { .xfer = TUSB_XFER_CONTROL },
|
|
.bmAttributes = { .xfer = TUSB_XFER_CONTROL },
|
|
|
- .wMaxPacketSize = { .size = CFG_TUD_ENDPOINT0_SIZE },
|
|
|
|
|
|
|
+ .wMaxPacketSize = CFG_TUD_ENDPOINT0_SIZE,
|
|
|
.bInterval = 0
|
|
.bInterval = 0
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -741,7 +741,7 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc
|
|
|
(void)rhport;
|
|
(void)rhport;
|
|
|
uint8_t const epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
|
|
uint8_t const epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
|
|
|
uint8_t const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
|
|
uint8_t const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
|
|
|
- const uint16_t epMaxPktSize = p_endpoint_desc->wMaxPacketSize.size;
|
|
|
|
|
|
|
+ const uint16_t epMaxPktSize = tu_edpt_packet_size(p_endpoint_desc);
|
|
|
uint16_t pma_addr;
|
|
uint16_t pma_addr;
|
|
|
uint32_t wType;
|
|
uint32_t wType;
|
|
|
|
|
|
|
@@ -778,19 +778,19 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc
|
|
|
// or being double-buffered (bulk endpoints)
|
|
// or being double-buffered (bulk endpoints)
|
|
|
pcd_clear_ep_kind(USB,0);
|
|
pcd_clear_ep_kind(USB,0);
|
|
|
|
|
|
|
|
- pma_addr = dcd_pma_alloc(p_endpoint_desc->bEndpointAddress, p_endpoint_desc->wMaxPacketSize.size);
|
|
|
|
|
|
|
+ pma_addr = dcd_pma_alloc(p_endpoint_desc->bEndpointAddress, epMaxPktSize);
|
|
|
|
|
|
|
|
if(dir == TUSB_DIR_IN)
|
|
if(dir == TUSB_DIR_IN)
|
|
|
{
|
|
{
|
|
|
*pcd_ep_tx_address_ptr(USB, epnum) = pma_addr;
|
|
*pcd_ep_tx_address_ptr(USB, epnum) = pma_addr;
|
|
|
- pcd_set_ep_tx_cnt(USB, epnum, p_endpoint_desc->wMaxPacketSize.size);
|
|
|
|
|
|
|
+ pcd_set_ep_tx_cnt(USB, epnum, epMaxPktSize);
|
|
|
pcd_clear_tx_dtog(USB, epnum);
|
|
pcd_clear_tx_dtog(USB, epnum);
|
|
|
pcd_set_ep_tx_status(USB,epnum,USB_EP_TX_NAK);
|
|
pcd_set_ep_tx_status(USB,epnum,USB_EP_TX_NAK);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
*pcd_ep_rx_address_ptr(USB, epnum) = pma_addr;
|
|
*pcd_ep_rx_address_ptr(USB, epnum) = pma_addr;
|
|
|
- pcd_set_ep_rx_cnt(USB, epnum, p_endpoint_desc->wMaxPacketSize.size);
|
|
|
|
|
|
|
+ pcd_set_ep_rx_cnt(USB, epnum, epMaxPktSize);
|
|
|
pcd_clear_rx_dtog(USB, epnum);
|
|
pcd_clear_rx_dtog(USB, epnum);
|
|
|
pcd_set_ep_rx_status(USB, epnum, USB_EP_RX_NAK);
|
|
pcd_set_ep_rx_status(USB, epnum, USB_EP_RX_NAK);
|
|
|
}
|
|
}
|