diff --git a/lib/tinyusb b/lib/tinyusb index c1bf19ed6cf..fcd5a0603e3 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit c1bf19ed6cf1eaa791f221c1bc5ce4b3d069f76d +Subproject commit fcd5a0603e3588cbf4b33f0335da2b630dc76368 diff --git a/shared-module/usb/core/Device.c b/shared-module/usb/core/Device.c index 83def37de91..53c87de180a 100644 --- a/shared-module/usb/core/Device.c +++ b/shared-module/usb/core/Device.c @@ -135,6 +135,7 @@ static bool _wait_for_callback(void) { switch (result) { case XFER_RESULT_SUCCESS: return true; + case XFER_RESULT_ABORTED: case XFER_RESULT_FAILED: mp_raise_usb_core_USBError(NULL); break; @@ -201,6 +202,7 @@ static size_t _handle_timed_transfer_callback(tuh_xfer_t *xfer, mp_int_t timeout switch (result) { case XFER_RESULT_SUCCESS: return _actual_len; + case XFER_RESULT_ABORTED: case XFER_RESULT_FAILED: mp_raise_usb_core_USBError(NULL); break; diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index a10cd712226..a34d22d5409 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -144,7 +144,7 @@ extern "C" { #define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX USB_AUDIO_N_BYTES_PER_SAMPLE #define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX USB_AUDIO_N_CHANNELS // wMaxPacketSize, sized for the highest supported sample rate. -#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX TUD_AUDIO_EP_SIZE(USB_AUDIO_MAX_SAMPLE_RATE, USB_AUDIO_N_BYTES_PER_SAMPLE, USB_AUDIO_N_CHANNELS) +#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX TUD_AUDIO_EP_SIZE(TUD_OPT_HIGH_SPEED, USB_AUDIO_MAX_SAMPLE_RATE, USB_AUDIO_N_BYTES_PER_SAMPLE, USB_AUDIO_N_CHANNELS) // Deep software FIFO so the 1 ms refill keeps clear of the underrun floor. #define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ (16 * CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX) @@ -156,7 +156,7 @@ extern "C" { #define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_RX USB_AUDIO_N_BYTES_PER_SAMPLE #define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX USB_AUDIO_N_CHANNELS // wMaxPacketSize, sized for the highest supported sample rate. -#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX TUD_AUDIO_EP_SIZE(USB_AUDIO_MAX_SAMPLE_RATE, USB_AUDIO_N_BYTES_PER_SAMPLE, USB_AUDIO_N_CHANNELS) +#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX TUD_AUDIO_EP_SIZE(TUD_OPT_HIGH_SPEED, USB_AUDIO_MAX_SAMPLE_RATE, USB_AUDIO_N_BYTES_PER_SAMPLE, USB_AUDIO_N_CHANNELS) // Deep software FIFO so the 1 ms drain keeps clear of the overrun ceiling. #define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ (16 * CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX) #endif diff --git a/supervisor/shared/usb/usb_device.c b/supervisor/shared/usb/usb_device.c index 16ae137edde..e3f1a0d4e26 100644 --- a/supervisor/shared/usb/usb_device.c +++ b/supervisor/shared/usb/usb_device.c @@ -156,7 +156,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ // size. Setting CFG_TUD_CDC_RX_BUFSIZE to the endpoint size and then sending // any character will prevent ctrl-c from working. Require at least a 64 // character buffer. -#if CFG_TUD_CDC_RX_BUFSIZE < CFG_TUD_CDC_EP_BUFSIZE + 64 +#if CFG_TUD_CDC_RX_BUFSIZE < CFG_TUD_CDC_RX_EPSIZE + 64 #error "CFG_TUD_CDC_RX_BUFSIZE must be 64 bytes bigger than endpoint size." #endif diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 1f40cebd0d2..e48c2146e7d 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -127,7 +127,6 @@ ifeq ($(CIRCUITPY_TINYUSB),1) SRC_SUPERVISOR += \ lib/tinyusb/src/class/cdc/cdc_device.c \ lib/tinyusb/src/device/usbd.c \ - lib/tinyusb/src/device/usbd_control.c \ supervisor/shared/usb/usb_desc.c \ supervisor/shared/usb/usb_device.c \