From 6894388135c4efd41cb4a96b6dac396b94c64eb9 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 16 Apr 2017 08:20:31 +0000 Subject: Tentative fix for missing RX events. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10157 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'os/hal/ports/STM32') 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 -- cgit v1.2.3