From 6f99026a648c6a78caa1a2189269db8ab7987aa9 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 4 Mar 2021 19:02:20 +0700 Subject: [PATCH 1/2] rp2040 use normal usb_irq_handler() --- ports/raspberrypi/supervisor/usb.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ports/raspberrypi/supervisor/usb.c b/ports/raspberrypi/supervisor/usb.c index 1d2425aed248..799ed06953ac 100644 --- a/ports/raspberrypi/supervisor/usb.c +++ b/ports/raspberrypi/supervisor/usb.c @@ -31,23 +31,17 @@ #include "src/rp2_common/pico_platform/include/pico/platform.h" #include "src/rp2040/hardware_regs/include/hardware/regs/intctrl.h" -static background_callback_t usb_callback; -static void usb_background_do(void* unused) { - usb_background(); -} - -static void queue_background(void) { - background_callback_add(&usb_callback, usb_background_do, NULL); -} - void init_usb_hardware(void) { } void post_usb_init(void) { + irq_set_enabled(USBCTRL_IRQ, false); + irq_handler_t usb_handler = irq_get_exclusive_handler(USBCTRL_IRQ); if (usb_handler) { irq_remove_handler(USBCTRL_IRQ, usb_handler); - irq_add_shared_handler(USBCTRL_IRQ, usb_handler, PICO_DEFAULT_IRQ_PRIORITY); } - irq_add_shared_handler(USBCTRL_IRQ, queue_background, PICO_LOWEST_IRQ_PRIORITY); + irq_set_exclusive_handler(USBCTRL_IRQ, usb_irq_handler); + + irq_set_enabled(USBCTRL_IRQ, true); } From c26120a3ac9d57f68afabf18d1e804a215f678ed Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 4 Mar 2021 21:02:32 +0700 Subject: [PATCH 2/2] update tinyusb --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 280297bdb7ae..5285548c7543 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 280297bdb7aec67adf347ec046943a48a71647df +Subproject commit 5285548c7543354ac8e13da37499019e204b1c49