diff --git a/conf.py b/conf.py index 7120fa3f00a35..6c30a43abb1f1 100644 --- a/conf.py +++ b/conf.py @@ -277,7 +277,6 @@ def autoapi_prepare_jinja_env(jinja_env): import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' -html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.'] # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/shared-module/usb/core/Device.c b/shared-module/usb/core/Device.c index 4ed0d410523e4..1a184f8b1b913 100644 --- a/shared-module/usb/core/Device.c +++ b/shared-module/usb/core/Device.c @@ -160,6 +160,7 @@ static size_t _xfer(tuh_xfer_t *xfer, mp_int_t timeout) { xfer->complete_cb = _transfer_done_cb; if (!tuh_edpt_xfer(xfer)) { mp_raise_usb_core_USBError(NULL); + return 0; } uint32_t start_time = supervisor_ticks_ms32(); while ((timeout == 0 || supervisor_ticks_ms32() - start_time < (uint32_t)timeout) && @@ -206,6 +207,7 @@ static bool _open_endpoint(usb_core_device_obj_t *self, mp_int_t endpoint) { if (self->configuration_descriptor == NULL) { mp_raise_usb_core_USBError(MP_ERROR_TEXT("No configuration set")); + return false; } tusb_desc_configuration_t *desc_cfg = (tusb_desc_configuration_t *)self->configuration_descriptor; @@ -240,6 +242,7 @@ static bool _open_endpoint(usb_core_device_obj_t *self, mp_int_t endpoint) { mp_int_t common_hal_usb_core_device_write(usb_core_device_obj_t *self, mp_int_t endpoint, const uint8_t *buffer, mp_int_t len, mp_int_t timeout) { if (!_open_endpoint(self, endpoint)) { mp_raise_usb_core_USBError(NULL); + return 0; } tuh_xfer_t xfer; xfer.daddr = self->device_number; @@ -252,6 +255,7 @@ mp_int_t common_hal_usb_core_device_write(usb_core_device_obj_t *self, mp_int_t mp_int_t common_hal_usb_core_device_read(usb_core_device_obj_t *self, mp_int_t endpoint, uint8_t *buffer, mp_int_t len, mp_int_t timeout) { if (!_open_endpoint(self, endpoint)) { mp_raise_usb_core_USBError(NULL); + return 0; } tuh_xfer_t xfer; xfer.daddr = self->device_number; @@ -286,6 +290,7 @@ mp_int_t common_hal_usb_core_device_ctrl_transfer(usb_core_device_obj_t *self, if (!tuh_control_xfer(&xfer)) { mp_raise_usb_core_USBError(NULL); + return 0; } uint32_t start_time = supervisor_ticks_ms32(); while ((timeout == 0 || supervisor_ticks_ms32() - start_time < (uint32_t)timeout) &&