@@ -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