Merge pull request #5238 from tannewt/fix_rp2_usb

Fix usb irq race
This commit is contained in:
Dan Halbert 2021-08-27 10:40:06 -04:00 committed by GitHub
commit 09897dbc82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -44,4 +44,10 @@ void post_usb_init(void) {
irq_set_exclusive_handler(USBCTRL_IRQ, usb_irq_handler);
irq_set_enabled(USBCTRL_IRQ, true);
// There is a small window where the USB interrupt may be handled by the
// pico-sdk instead of CircuitPython. If that is the case, then we'll have
// USB events to process that we didn't queue up a background task for. So,
// queue one up here even if we might not have anything to do.
usb_background_schedule();
}