Fixed possible race condition (#487)

This commit is contained in:
robbederks 2020-04-07 14:59:19 -07:00 committed by GitHub
parent a05361ebc2
commit 74d10ccd38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -941,10 +941,12 @@ void usb_irqhandler(void) {
}
void usb_outep3_resume_if_paused() {
ENTER_CRITICAL();
if (!outep3_processing && (USBx_OUTEP(3)->DOEPCTL & USB_OTG_DOEPCTL_NAKSTS) != 0) {
USBx_OUTEP(3)->DOEPTSIZ = (1U << 19) | 0x40U;
USBx_OUTEP(3)->DOEPCTL |= USB_OTG_DOEPCTL_EPENA | USB_OTG_DOEPCTL_CNAK;
}
EXIT_CRITICAL();
}
void OTG_FS_IRQ_Handler(void) {