mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-16 05:42:56 +00:00
Merge pull request #271 from majbthrd/nucoutmps
nuc121: fix handling of OUT transfers larger than max packet size
This commit is contained in:
commit
906471a487
@ -395,9 +395,11 @@ void USBD_IRQHandler(void)
|
|||||||
xfer->remaining_bytes -= available_bytes;
|
xfer->remaining_bytes -= available_bytes;
|
||||||
xfer->data_ptr += 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) )
|
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)
|
||||||
|
ep->MXPLD = xfer->max_packet_size;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user