From 9825fbe9ac69cea94942361ac47080b7f5a0a1cd Mon Sep 17 00:00:00 2001 From: rppicomidi Date: Wed, 23 Nov 2022 13:12:31 -0800 Subject: [PATCH] Fix RP2040 Issue 1721 --- src/portable/raspberrypi/rp2040/rp2040_usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.c b/src/portable/raspberrypi/rp2040/rp2040_usb.c index 25c013bd..d7895175 100644 --- a/src/portable/raspberrypi/rp2040/rp2040_usb.c +++ b/src/portable/raspberrypi/rp2040/rp2040_usb.c @@ -155,7 +155,9 @@ static void __tusb_irq_path_func(_hw_endpoint_start_next_buffer)(struct hw_endpo // For now: skip double buffered for Device mode, OUT endpoint since // host could send < 64 bytes and cause short packet on buffer0 // NOTE this could happen to Host mode IN endpoint - bool const force_single = !(usb_hw->main_ctrl & USB_MAIN_CTRL_HOST_NDEVICE_BITS) && !tu_edpt_dir(ep->ep_addr); + // Also, Host mode interrupt endpoint hardware is only single buffered + bool const force_single = (!(usb_hw->main_ctrl & USB_MAIN_CTRL_HOST_NDEVICE_BITS) && !tu_edpt_dir(ep->ep_addr)) || + ((usb_hw->main_ctrl & USB_MAIN_CTRL_HOST_NDEVICE_BITS) && tu_edpt_number(ep->ep_addr) != 0); if(ep->remaining_len && !force_single) {