summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Lawrence <[email protected]>2020-01-14 22:07:38 -0600
committerPeter Lawrence <[email protected]>2020-01-14 22:07:38 -0600
commitf2a5335417004cdc9398e3beac1f4861a5e29e0a (patch)
treec9cccd8991ac9d287adcc0a9cc1921cf3d0ac662 /src
parent1210beb9063c5234b9d730089dcaa8cc3b2edd9c (diff)
nuc121: fix handling of OUT transfers larger than max packet size
Diffstat (limited to 'src')
-rw-r--r--src/portable/nuvoton/nuc121/dcd_nuc121.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/portable/nuvoton/nuc121/dcd_nuc121.c b/src/portable/nuvoton/nuc121/dcd_nuc121.c
index afe2cf001..892a20aa4 100644
--- a/src/portable/nuvoton/nuc121/dcd_nuc121.c
+++ b/src/portable/nuvoton/nuc121/dcd_nuc121.c
@@ -395,9 +395,11 @@ void USBD_IRQHandler(void)
xfer->remaining_bytes -= available_bytes;
xfer->data_ptr += available_bytes;
- /* when the transfer is finished, alert TinyUSB */
+ /* when the transfer is finished, alert TinyUSB; otherwise, accept more data */
if ( (0 == xfer->remaining_bytes) || (available_bytes < xfer->max_packet_size) )
dcd_event_xfer_complete(0, ep_addr, available_bytes, XFER_RESULT_SUCCESS, true);
+ else if (xfer->remaining_bytes)
+ ep->MXPLD = xfer->max_packet_size;
}
else
{