aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/platforms')
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c
index 85b35d829..34034d7ca 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.c
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c
@@ -681,8 +681,12 @@ void usb_lld_start(USBDriver *usbp) {
OTG->DIEPMSK = 0;
OTG->DOEPMSK = 0;
OTG->DAINTMSK = 0;
- OTG->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM | /*GINTMSK_USBSUSPM |
- GINTMSK_ESUSPM |*/ GINTMSK_SOFM;
+ if (usbp->config->sof_cb == NULL)
+ OTG->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM /*| GINTMSK_USBSUSPM |
+ GINTMSK_ESUSPM |*/;
+ else
+ OTG->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM /*| GINTMSK_USBSUSPM |
+ GINTMSK_ESUSPM */ | GINTMSK_SOFM;
OTG->GINTSTS = 0xFFFFFFFF; /* Clears all pending IRQs, if any. */
/* Global interrupts enable.*/