From 46389ab806fdc429ef215ca1b293ac14c95e9cd4 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 17 Apr 2017 13:31:22 +0000 Subject: Reverted tentative fix in STM32 OTGv1 driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10159 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c | 10 +++++++--- 1 file changed, 7 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 04425412e..519407b77 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c +++ b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c @@ -290,6 +290,12 @@ static void otg_rxfifo_handler(USBDriver *usbp) { break; case GRXSTSP_OUT_DATA: cnt = (sts & GRXSTSP_BCNT_MASK) >> GRXSTSP_BCNT_OFF; + + if (cnt == 0) { + asm ("nop"); + } + + ep = (sts & GRXSTSP_EPNUM_MASK) >> GRXSTSP_EPNUM_OFF; otg_fifo_read_to_buffer(usbp->otg->FIFO[0], usbp->epc[ep]->out_state->rxbuf, @@ -427,9 +433,7 @@ 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) && - (osp->rxsize < osp->totsize)) {*/ - if (((otgp->oe[ep].DOEPTSIZ & DOEPTSIZ_PKTCNT_MASK) == 0) && + if (((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 -- cgit v1.2.3