Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions shared-module/usb/core/Device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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) &&
Expand Down