|
|
@@ -37,9 +37,9 @@
|
|
|
// We disable SOF for now until needed later on
|
|
|
#define USE_SOF 0
|
|
|
|
|
|
-#if TUSB_OPT_DEVICE_ENABLED && \
|
|
|
- ( (CFG_TUSB_MCU == OPT_MCU_BCM2711 ) \
|
|
|
- )
|
|
|
+#if TUSB_OPT_DEVICE_ENABLED && \
|
|
|
+ (CFG_TUSB_MCU == OPT_MCU_BCM2711 ) \
|
|
|
+
|
|
|
|
|
|
// EP_MAX : Max number of bi-directional endpoints including EP0
|
|
|
// EP_FIFO_SIZE : Size of dedicated USB SRAM
|
|
|
@@ -656,10 +656,10 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
|
|
|
TU_ASSERT(epnum < EP_MAX);
|
|
|
|
|
|
xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
|
|
|
- xfer->max_size = desc_edpt->wMaxPacketSize.size;
|
|
|
+ xfer->max_size = tu_edpt_packet_size(desc_edpt);
|
|
|
xfer->interval = desc_edpt->bInterval;
|
|
|
|
|
|
- uint16_t const fifo_size = (desc_edpt->wMaxPacketSize.size + 3) / 4; // Round up to next full word
|
|
|
+ uint16_t const fifo_size = (xfer->max_size + 3) / 4; // Round up to next full word
|
|
|
|
|
|
if(dir == TUSB_DIR_OUT)
|
|
|
{
|
|
|
@@ -678,7 +678,7 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
|
|
|
out_ep[epnum].DOEPCTL |= (1 << USB_OTG_DOEPCTL_USBAEP_Pos) |
|
|
|
(desc_edpt->bmAttributes.xfer << USB_OTG_DOEPCTL_EPTYP_Pos) |
|
|
|
(desc_edpt->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS ? USB_OTG_DOEPCTL_SD0PID_SEVNFRM : 0) |
|
|
|
- (desc_edpt->wMaxPacketSize.size << USB_OTG_DOEPCTL_MPSIZ_Pos);
|
|
|
+ (xfer->max_size << USB_OTG_DOEPCTL_MPSIZ_Pos);
|
|
|
|
|
|
dev->DAINTMSK |= (1 << (USB_OTG_DAINTMSK_OEPM_Pos + epnum));
|
|
|
}
|
|
|
@@ -720,7 +720,7 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
|
|
|
(epnum << USB_OTG_DIEPCTL_TXFNUM_Pos) |
|
|
|
(desc_edpt->bmAttributes.xfer << USB_OTG_DIEPCTL_EPTYP_Pos) |
|
|
|
(desc_edpt->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS ? USB_OTG_DIEPCTL_SD0PID_SEVNFRM : 0) |
|
|
|
- (desc_edpt->wMaxPacketSize.size << USB_OTG_DIEPCTL_MPSIZ_Pos);
|
|
|
+ (xfer->max_size << USB_OTG_DIEPCTL_MPSIZ_Pos);
|
|
|
|
|
|
dev->DAINTMSK |= (1 << (USB_OTG_DAINTMSK_IEPM_Pos + epnum));
|
|
|
}
|
|
|
@@ -1010,7 +1010,7 @@ static void handle_rxflvl_ints(uint8_t rhport, USB_OTG_OUTEndpointTypeDef * out_
|
|
|
if (xfer->ff)
|
|
|
{
|
|
|
// Ring buffer
|
|
|
- tu_fifo_write_n_const_addr_full_words(xfer->ff, (const void *) rx_fifo, bcnt);
|
|
|
+ tu_fifo_write_n_const_addr_full_words(xfer->ff, (const void *)(uintptr_t) rx_fifo, bcnt);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -1130,7 +1130,7 @@ static void handle_epin_ints(uint8_t rhport, USB_OTG_DeviceTypeDef * dev, USB_OT
|
|
|
if (xfer->ff)
|
|
|
{
|
|
|
usb_fifo_t tx_fifo = FIFO_BASE(rhport, n);
|
|
|
- tu_fifo_read_n_const_addr_full_words(xfer->ff, (void *) tx_fifo, packet_size);
|
|
|
+ tu_fifo_read_n_const_addr_full_words(xfer->ff, (void *)(uintptr_t) tx_fifo, packet_size);
|
|
|
}
|
|
|
else
|
|
|
{
|