Skip to content

Commit 62d849a

Browse files
committed
Update DCD xfer->max_size
1 parent bafd209 commit 62d849a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

components/arduino_tinyusb/src/dcd_esp32sx.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,18 +299,17 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const *desc_edpt)
299299
uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
300300
uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress);
301301

302-
TU_ASSERT(desc_edpt->wMaxPacketSize.size <= 64);
303302
TU_ASSERT(epnum < EP_MAX);
304303

305304
xfer_ctl_t *xfer = XFER_CTL_BASE(epnum, dir);
306-
xfer->max_size = desc_edpt->wMaxPacketSize.size;
305+
xfer->max_size = tu_edpt_packet_size(desc_edpt);
307306

308307
if (dir == TUSB_DIR_OUT) {
309308
out_ep[epnum].doepctl &= ~(USB_D_EPTYPE0_M | USB_D_MPS0_M);
310309
out_ep[epnum].doepctl |= USB_USBACTEP1_M |
311310
desc_edpt->bmAttributes.xfer << USB_EPTYPE1_S |
312311
(desc_edpt->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS ? USB_DO_SETD0PID1_M : 0) |
313-
desc_edpt->wMaxPacketSize.size << USB_MPS1_S;
312+
xfer->max_size << USB_MPS1_S;
314313
USB0.daintmsk |= (1 << (16 + epnum));
315314
} else {
316315
// "USB Data FIFOs" section in reference manual
@@ -351,7 +350,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const *desc_edpt)
351350
fifo_num << USB_D_TXFNUM1_S |
352351
desc_edpt->bmAttributes.xfer << USB_D_EPTYPE1_S |
353352
(desc_edpt->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS ? (1 << USB_DI_SETD0PID1_S) : 0) |
354-
desc_edpt->wMaxPacketSize.size << 0;
353+
xfer->max_size << 0;
355354

356355
USB0.daintmsk |= (1 << (0 + epnum));
357356

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy