stm32: Fix usbotg irq wakeup notification
The DAINTMSK prevents irqs but does not prevent the status reporting in the GINTSTS and DAINT fields. Thus, the mask bits should be checked prior to sending a wakeup notification. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
10e816979e
commit
8b2074e068
|
@ -397,11 +397,11 @@ OTG_FS_IRQHandler(void)
|
||||||
}
|
}
|
||||||
if (sts & USB_OTG_GINTSTS_IEPINT) {
|
if (sts & USB_OTG_GINTSTS_IEPINT) {
|
||||||
// Can transmit data - disable irq and notify endpoint
|
// Can transmit data - disable irq and notify endpoint
|
||||||
uint32_t daint = OTGD->DAINT;
|
uint32_t daint = OTGD->DAINT, msk = OTGD->DAINTMSK, pend = daint & msk;
|
||||||
OTGD->DAINTMSK &= ~daint;
|
OTGD->DAINTMSK = msk & ~daint;
|
||||||
if (daint & (1 << 0))
|
if (pend & (1 << 0))
|
||||||
usb_notify_ep0();
|
usb_notify_ep0();
|
||||||
if (daint & (1 << USB_CDC_EP_BULK_IN))
|
if (pend & (1 << USB_CDC_EP_BULK_IN))
|
||||||
usb_notify_bulk_in();
|
usb_notify_bulk_in();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue