Fix usb irq race

Run the USB background once after we hook our IRQ up in case we
missed one.

Related to #5212
This commit is contained in:
Scott Shawcroft 2021-08-26 10:20:26 -07:00
parent b36187102f
commit 9663a227a3
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
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();
}