diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/STM32/LLD/OTGv1/usb_lld.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c index 83997cc18..e86268211 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c +++ b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c @@ -817,17 +817,6 @@ void usb_lld_start(USBDriver *usbp) { usbp->txpending = 0;
-#if defined(_CHIBIOS_RT_)
- /* Creates the data pump threads in a suspended state. Note, it is
- created only once, the first time @p usbStart() is invoked.*/
- if (usbp->tr == NULL)
- usbp->tr = usbp->wait = chThdCreateI(usbp->wa_pump,
- sizeof usbp->wa_pump,
- STM32_USB_OTG_THREAD_PRIO,
- usb_lld_pump,
- usbp);
-#endif
-
/* - Forced device mode.
- USB turn-around time = TRDT_VALUE.
- Full Speed 1.1 PHY.*/
@@ -869,6 +858,17 @@ void usb_lld_start(USBDriver *usbp) { GINTMSK_ESUSPM */ | GINTMSK_SOFM;
otgp->GINTSTS = 0xFFFFFFFF; /* Clears all pending IRQs, if any. */
+#if defined(_CHIBIOS_RT_)
+ /* Creates the data pump thread. Note, it is created only once.*/
+ if (usbp->tr == NULL) {
+ usbp->tr = chThdCreateI(usbp->wa_pump, sizeof usbp->wa_pump,
+ STM32_USB_OTG_THREAD_PRIO,
+ usb_lld_pump, usbp);
+ chThdStartI(usbp->tr);
+ chSchRescheduleS();
+ }
+#endif
+
/* Global interrupts enable.*/
otgp->GAHBCFG |= GAHBCFG_GINTMSK;
}
|