stm32f4: Fix incorrect xfer length for short packet IN xfers.

This commit is contained in:
William D. Jones 2019-01-23 00:44:55 -05:00
parent d1150432fe
commit 17e418bce4
1 changed files with 2 additions and 1 deletions

View File

@ -488,7 +488,8 @@ void OTG_FS_IRQHandler(void) {
uint16_t remaining = (in_ep[n].DIEPTSIZ & USB_OTG_DIEPTSIZ_XFRSIZ_Msk) >> USB_OTG_DIEPTSIZ_XFRSIZ_Pos;
xfer->queued_len = xfer->total_len - remaining;
for(uint8_t i = 0; i < xfer->max_size; i++) {
uint16_t to_xfer_size = (remaining > xfer->max_size) ? xfer->max_size : remaining;
for(uint16_t i = 0; i < to_xfer_size; i++) {
(* tx_fifo) = xfer->buffer[xfer->queued_len + i];
}
}