From 82e9c928eb0adc2508bbd70b458362efa512049b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 26 Oct 2014 13:01:33 +0000 Subject: Fixed bug #542. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7430 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/OTGv1/usb_lld.c | 5 ++--- testhal/STM32/STM32F4xx/USB_CDC/main.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c index 100539410..eb6af99ca 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c +++ b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c @@ -624,7 +624,8 @@ static void usb_lld_serve_interrupt(USBDriver *usbp) { stm32_otg_t *otgp = usbp->otg; uint32_t sts, src; - sts = otgp->GINTSTS & otgp->GINTMSK; + sts = otgp->GINTSTS; + sts &= otgp->GINTMSK; otgp->GINTSTS = sts; /* Reset interrupt handling.*/ @@ -1346,8 +1347,6 @@ msg_t usb_lld_pump(void *p) { } osalSysLock(); } - osalSysUnlock(); - return 0; } #endif /* HAL_USE_USB */ diff --git a/testhal/STM32/STM32F4xx/USB_CDC/main.c b/testhal/STM32/STM32F4xx/USB_CDC/main.c index 054c4e23c..a8b57cd25 100644 --- a/testhal/STM32/STM32F4xx/USB_CDC/main.c +++ b/testhal/STM32/STM32F4xx/USB_CDC/main.c @@ -442,7 +442,7 @@ static msg_t Thread1(void *arg) { (void)arg; chRegSetThreadName("blinker"); - while (TRUE) { + while (true) { systime_t time; time = serusbcfg.usbp->state == USB_ACTIVE ? 250 : 500; -- cgit v1.2.3