diff options
-rw-r--r-- | os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c | 10 |
1 files 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
|