From cd31eec2cf409a83d6c937eaca4c7d80d04167fa Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 18 Aug 2012 17:53:25 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4581 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/OTGv1/usb_lld.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c index 40894a4c4..5d7e75fc6 100644 --- a/os/hal/platforms/STM32/OTGv1/usb_lld.c +++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c @@ -830,15 +830,6 @@ void usb_lld_start(USBDriver *usbp) { /* Enables IRQ vector.*/ nvicEnableVector(STM32_OTG1_NUMBER, CORTEX_PRIORITY_MASK(STM32_USB_OTG1_IRQ_PRIORITY)); - - /* Creates the hauler threads in a suspended state. Note, it is - created only once, the first time @p usbStart() is invoked.*/ - if (usbp->thd_ptr == NULL) - usbp->thd_ptr = usbp->thd_wait = chThdCreateI(usbp->wa_pump, - sizeof usbp->wa_pump, - STM32_USB_THREAD_PRIORITY, - usb_lld_pump, - usbp); } #endif #if STM32_USB_USE_OTG2 @@ -850,18 +841,18 @@ void usb_lld_start(USBDriver *usbp) { /* Enables IRQ vector.*/ nvicEnableVector(STM32_OTG2_NUMBER, CORTEX_PRIORITY_MASK(STM32_USB_OTG2_IRQ_PRIORITY)); - - /* Creates the hauler threads in a suspended state. Note, it is - created only once, the first time @p usbStart() is invoked.*/ - if (usbp->thd_ptr == NULL) - usbp->thd_ptr = usbp->thd_wait = chThdCreateI(usbp->wa_pump, - sizeof usbp->wa_pump, - STM32_USB_THREAD_PRIORITY, - usb_lld_pump, - usbp); } #endif + /* Creates the hauler threads in a suspended state. Note, it is + created only once, the first time @p usbStart() is invoked.*/ + if (usbp->thd_ptr == NULL) + usbp->thd_ptr = usbp->thd_wait = chThdCreateI(usbp->wa_pump, + sizeof usbp->wa_pump, + STM32_USB_THREAD_PRIORITY, + usb_lld_pump, + usbp); + /* - Forced device mode. - USB turn-around time = TRDT_VALUE. - Full Speed 1.1 PHY.*/ @@ -873,12 +864,12 @@ void usb_lld_start(USBDriver *usbp) { /* PHY enabled.*/ otgp->PCGCCTL = 0; - /* Soft core reset.*/ - otg_core_reset(otgp); - /* Internal FS PHY activation.*/ otgp->GCCFG = GCCFG_PWRDWN; + /* Soft core reset.*/ + otg_core_reset(otgp); + /* Interrupts on TXFIFOs half empty.*/ otgp->GAHBCFG = 0; -- cgit v1.2.3