aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-18 17:53:25 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-18 17:53:25 +0000
commitcd31eec2cf409a83d6c937eaca4c7d80d04167fa (patch)
tree93c0057b15aef586983b35f6981667fc51e8afc2 /os
parent4871d5b035ec259cbdd28cab052af81db0b6679e (diff)
downloadChibiOS-cd31eec2cf409a83d6c937eaca4c7d80d04167fa.tar.gz
ChibiOS-cd31eec2cf409a83d6c937eaca4c7d80d04167fa.tar.bz2
ChibiOS-cd31eec2cf409a83d6c937eaca4c7d80d04167fa.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4581 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.c33
1 files 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;