Просмотр исходного кода

nuc121: better fix for handling large OUT transfers

Peter Lawrence 6 лет назад
Родитель
Сommit
7f2db321bf
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/portable/nuvoton/nuc121/dcd_nuc121.c

+ 1 - 1
src/portable/nuvoton/nuc121/dcd_nuc121.c

@@ -397,7 +397,7 @@ void USBD_IRQHandler(void)
 
 
           /* when the transfer is finished, alert TinyUSB; otherwise, accept more data */
           /* when the transfer is finished, alert TinyUSB; otherwise, accept more data */
           if ( (0 == xfer->remaining_bytes) || (available_bytes < xfer->max_packet_size) )
           if ( (0 == xfer->remaining_bytes) || (available_bytes < xfer->max_packet_size) )
-            dcd_event_xfer_complete(0, ep_addr, available_bytes, XFER_RESULT_SUCCESS, true);
+            dcd_event_xfer_complete(0, ep_addr, xfer->total_bytes, XFER_RESULT_SUCCESS, true);
           else if (xfer->remaining_bytes)
           else if (xfer->remaining_bytes)
             ep->MXPLD = xfer->max_packet_size;
             ep->MXPLD = xfer->max_packet_size;
         }
         }