aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c
index 9d899fd68..2653698fd 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.c
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c
@@ -617,13 +617,13 @@ static void usb_lld_serve_interrupt(USBDriver *usbp) {
be triggered again.*/
otgp->GINTMSK &= ~GINTMSK_RXFLVLM;
/* Checks if the thread is waiting for an event.*/
+ chSysLockFromIsr();
if (usbp->thd_wait != NULL) {
/* The thread is made ready, it will be scheduled on ISR exit.*/
- chSysLockFromIsr();
chThdResumeI(usbp->thd_wait);
usbp->thd_wait = NULL;
- chSysUnlockFromIsr();
}
+ chSysUnlockFromIsr();
}
/* IN/OUT endpoints event handling.*/