aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm32')
-rw-r--r--src/stm32/usbotg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/stm32/usbotg.c b/src/stm32/usbotg.c
index b61c99ca..74829256 100644
--- a/src/stm32/usbotg.c
+++ b/src/stm32/usbotg.c
@@ -397,11 +397,11 @@ OTG_FS_IRQHandler(void)
}
if (sts & USB_OTG_GINTSTS_IEPINT) {
// Can transmit data - disable irq and notify endpoint
- uint32_t daint = OTGD->DAINT;
- OTGD->DAINTMSK &= ~daint;
- if (daint & (1 << 0))
+ uint32_t daint = OTGD->DAINT, msk = OTGD->DAINTMSK, pend = daint & msk;
+ OTGD->DAINTMSK = msk & ~daint;
+ if (pend & (1 << 0))
usb_notify_ep0();
- if (daint & (1 << USB_CDC_EP_BULK_IN))
+ if (pend & (1 << USB_CDC_EP_BULK_IN))
usb_notify_bulk_in();
}
}