From f95c389800afe4c6349c80c4ea5253153c5910a1 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 23 Apr 2017 19:39:19 +0000 Subject: Fixed bug #832. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10167 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'os/hal/ports/STM32/LLD/OTGv1') 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; -- cgit v1.2.3