aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c6
1 files changed, 4 insertions, 2 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 5069a915a..04425412e 100644
--- a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
+++ b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
@@ -419,7 +419,7 @@ static void otg_epout_handler(USBDriver *usbp, usbep_t ep) {
USBOutEndpointState *osp;
/* Receive transfer complete, checking if it is a SETUP transfer on EP0,
- that it must be ignored, the STUPM handler will take care of it.*/
+ than it must be ignored, the STUPM handler will take care of it.*/
if ((ep == 0) && (usbp->ep0state == USB_EP0_WAITING_SETUP))
return;
@@ -427,7 +427,9 @@ 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 (((osp->rxcnt % usbp->epc[ep]->out_maxsize) == 0) &&
+ (osp->rxsize < osp->totsize)) {*/
+ if (((otgp->oe[ep].DOEPTSIZ & DOEPTSIZ_PKTCNT_MASK) == 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