summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/stm32/usb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/chip/stm32/usb.c b/chip/stm32/usb.c
index c97c68f03c..dfec42b5f8 100644
--- a/chip/stm32/usb.c
+++ b/chip/stm32/usb.c
@@ -456,8 +456,12 @@ void usb_wake(void)
* 2 and 3 ms.
*/
esof_count = 3;
+
+ /* STM32_USB_CNTR can also be updated from interrupt context. */
+ interrupt_disable();
STM32_USB_CNTR |= STM32_USB_CNTR_RESUME |
- STM32_USB_CNTR_ESOFM | STM32_USB_CNTR_SOFM;
+ STM32_USB_CNTR_ESOFM | STM32_USB_CNTR_SOFM;
+ interrupt_enable();
/* Try side-band wake as well. */
board_usb_wake();