8000 Merge pull request #5238 from tannewt/fix_rp2_usb · pypewpew/circuitpython@09897db · GitHub
[go: up one dir, main page]

Skip to content

Commit 09897db

Browse files
authored
Merge pull request adafruit#5238 from tannewt/fix_rp2_usb
Fix usb irq race
2 parents c174b7c + 9663a22 commit 09897db

File tree

1 file changed

+6
-0
lines changed
  • ports/raspberrypi/supervisor

1 file changed

+6
-0
lines changed

ports/raspberrypi/supervisor/usb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ void post_usb_init(void) {
4444
irq_set_exclusive_handler(USBCTRL_IRQ, usb_irq_handler);
4545

4646
irq_set_enabled(USBCTRL_IRQ, true);
47+
48+
// There is a small window where the USB interrupt may be handled by the
49+
// pico-sdk instead of CircuitPython. If that is the case, then we'll have
50+
// USB events to process that we didn't queue up a background task for. So,
51+
// queue one up here even if we might not have anything to do.
52+
usb_background_schedule();
4753
}

0 commit comments

Comments
 (0)
0