aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/OTGv1
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/OTGv1')
-rw-r--r--os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
index 519407b77..4de13ce6c 100644
--- a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
+++ b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
@@ -433,10 +433,11 @@ static void otg_epout_handler(USBDriver *usbp, usbep_t ep) {
osp = usbp->epc[ep]->out_state;
/* A short packet always terminates a transaction.*/
- if (((osp->rxcnt % usbp->epc[ep]->out_maxsize) == 0) &&
+ if ((ep == 0) &&
+ ((osp->rxcnt % usbp->epc[ep]->out_maxsize) == 0) &&
(osp->rxsize < osp->totsize)) {
- /* In case the transaction covered only part of the total transfer
- then another transaction is immediately started in order to
+ /* For EP 0 only, in case the transaction covered only part of the total
+ transfer then another transaction is immediately started in order to
cover the remaining.*/
osp->rxsize = osp->totsize - osp->rxsize;
osp->rxcnt = 0;