Skip to content

Commit 4c42cdb

Browse files
author
Cruz Monrreal
authored
Merge pull request #6704 from maciejbocianski/hal-usb_impl_usbdevice_ret_fix
USBDevice: endpoint_add/read_start functions return value fix
2 parents ef33147 + 4f91d65 commit 4c42cdb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

usb/device/USBDevice/USBDevice.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,8 @@ bool USBDevice::endpoint_add(usb_ep_t endpoint, uint32_t max_packet_size, usb_ep
10631063
MBED_ASSERT(!(info->flags & ENDPOINT_ENABLED));
10641064
MBED_ASSERT(max_packet_size <= 1024);
10651065

1066-
bool ret = false;
1067-
if (_phy->endpoint_add(endpoint, max_packet_size, type)) {
1066+
bool ret = _phy->endpoint_add(endpoint, max_packet_size, type);
1067+
if (ret) {
10681068
info->callback = callback;
10691069
info->flags |= ENDPOINT_ENABLED;
10701070
info->pending = 0;
@@ -1366,7 +1366,7 @@ bool USBDevice::read_start(usb_ep_t endpoint, uint8_t *buffer, uint32_t max_size
13661366

13671367
unlock();
13681368

1369-
return true;
1369+
return ret;
13701370
}
13711371

13721372
uint32_t USBDevice::read_finish(usb_ep_t endpoint)

0 commit comments

Comments
 (0)