mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
Clear ep0_pending if rx short packet
This commit is contained in:
parent
9e35ef73f7
commit
378e6aab8c
@ -578,9 +578,12 @@ static void handle_rxflvl_ints(USB_OTG_OUTEndpointTypeDef * out_ep) {
|
||||
xfer->buffer += bcnt;
|
||||
|
||||
// Truncate transfer length in case of short packet
|
||||
if(bcnt < xfer->max_size){
|
||||
if(bcnt < xfer->max_size) {
|
||||
xfer->total_len -= (out_ep[epnum].DOEPTSIZ & USB_OTG_DOEPTSIZ_XFRSIZ_Msk) >> USB_OTG_DOEPTSIZ_XFRSIZ_Pos;
|
||||
if(epnum == 0) xfer->total_len -= ep0_pending[TUSB_DIR_OUT];
|
||||
if(epnum == 0) {
|
||||
xfer->total_len -= ep0_pending[TUSB_DIR_OUT];
|
||||
ep0_pending[TUSB_DIR_OUT] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user