aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/OTGv1
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-04-23 19:39:19 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-04-23 19:39:19 +0000
commitf95c389800afe4c6349c80c4ea5253153c5910a1 (patch)
tree94aa7a1bbcaf069e6f576a16ef7dbf391087c51f /os/hal/ports/STM32/LLD/OTGv1
parentb898a2ee3141d05df99e1faf0bc3bdfd2a2e9ec1 (diff)
downloadChibiOS-f95c389800afe4c6349c80c4ea5253153c5910a1.tar.gz
ChibiOS-f95c389800afe4c6349c80c4ea5253153c5910a1.tar.bz2
ChibiOS-f95c389800afe4c6349c80c4ea5253153c5910a1.zip
Fixed bug #832.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10167 35acf78f-673a-0410-8e92-d51de3d6d3f4
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;