aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-13 13:21:42 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-13 13:21:42 +0000
commit55f4744930ce753eeb04ae939baa6de885972c8d (patch)
tree2d00c2e22a12212c643dabdddada3d19277ecfff /os/hal/platforms
parentdfe8c5f59d5ebe47496a99396127867a2455a31a (diff)
downloadChibiOS-55f4744930ce753eeb04ae939baa6de885972c8d.tar.gz
ChibiOS-55f4744930ce753eeb04ae939baa6de885972c8d.tar.bz2
ChibiOS-55f4744930ce753eeb04ae939baa6de885972c8d.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4564 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c
index 78fc45a71..c0785a2e6 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.c
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c
@@ -454,6 +454,12 @@ static void otg_txfifo_handler(USBDriver *usbp, usbep_t ep) {
while (TRUE) {
uint32_t n;
+ /* Interrupt disabled on transaction end.*/
+ if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) {
+ OTG->DIEPEMPMSK &= ~DIEPEMPMSK_INEPTXFEM(ep);
+ return;
+ }
+
/* Number of bytes remaining in current transaction.*/
n = usbp->epc[ep]->in_state->txsize - usbp->epc[ep]->in_state->txcnt;
if (n > usbp->epc[ep]->in_maxsize)
@@ -479,12 +485,6 @@ static void otg_txfifo_handler(USBDriver *usbp, usbep_t ep) {
usbp->epc[ep]->in_state->mode.linear.txbuf += n;
}
usbp->epc[ep]->in_state->txcnt += n;
-
- /* Interrupt disabled on transaction end.*/
- if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) {
- OTG->DIEPEMPMSK &= ~DIEPEMPMSK_INEPTXFEM(ep);
- return;
- }
}
}