aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-11-28 17:58:01 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-11-28 17:58:01 +0000
commit61d16a339ee3ff93fcae6bf3c07afe0977715341 (patch)
tree99cf97c0f21c5fe8caadcd5124d85bb76e40491a /os
parent233ac50d2500c01f66f75ffc8ad000a18c6939f3 (diff)
downloadChibiOS-61d16a339ee3ff93fcae6bf3c07afe0977715341.tar.gz
ChibiOS-61d16a339ee3ff93fcae6bf3c07afe0977715341.tar.bz2
ChibiOS-61d16a339ee3ff93fcae6bf3c07afe0977715341.zip
Fixed bug #674 (again).
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8542 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/STM32/LLD/OTGv1/usb_lld.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c
index 85be3e26f..ae944f77d 100644
--- a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c
+++ b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c
@@ -147,32 +147,11 @@ static void otg_disable_ep(USBDriver *usbp) {
unsigned i;
for (i = 0; i <= usbp->otgparams->num_endpoints; i++) {
- /* Disable only if enabled because this sentence in the manual:
- "The application must set this bit only if Endpoint Enable is
- already set for this endpoint".*/
- if ((otgp->ie[i].DIEPCTL & DIEPCTL_EPENA) != 0) {
- otgp->ie[i].DIEPCTL = DIEPCTL_EPDIS;
- /* Wait for endpoint disable.*/
- while (!(otgp->ie[i].DIEPINT & DIEPINT_EPDISD))
- ;
- }
- else
- otgp->ie[i].DIEPCTL = 0;
+ otgp->ie[i].DIEPCTL &= ~DIEPCTL_EPENA;
otgp->ie[i].DIEPTSIZ = 0;
otgp->ie[i].DIEPINT = 0xFFFFFFFF;
- /* Disable only if enabled because this sentence in the manual:
- "The application must set this bit only if Endpoint Enable is
- already set for this endpoint".
- Note that the attempt to disable the OUT EP0 is ignored by the
- hardware but the code is simpler this way.*/
- if ((otgp->oe[i].DOEPCTL & DOEPCTL_EPENA) != 0) {
- otgp->oe[i].DOEPCTL = DOEPCTL_EPDIS;
- /* Wait for endpoint disable.*/
- while (!(otgp->oe[i].DOEPCTL & DOEPCTL_EPDIS))
- ;
- }
- else
- otgp->oe[i].DOEPCTL = 0;
+
+ otgp->oe[i].DOEPCTL &= ~DOEPCTL_EPENA;
otgp->oe[i].DOEPTSIZ = 0;
otgp->oe[i].DOEPINT = 0xFFFFFFFF;
}