mirror of https://github.com/ARMmbed/mbed-os.git
USBDevice: endpoint_add/read_start functions return value fix
parent
6c427ee369
commit
0bdeb0450e
|
@ -1063,8 +1063,8 @@ bool USBDevice::endpoint_add(usb_ep_t endpoint, uint32_t max_packet_size, usb_ep
|
||||||
MBED_ASSERT(!(info->flags & ENDPOINT_ENABLED));
|
MBED_ASSERT(!(info->flags & ENDPOINT_ENABLED));
|
||||||
MBED_ASSERT(max_packet_size <= 1024);
|
MBED_ASSERT(max_packet_size <= 1024);
|
||||||
|
|
||||||
bool ret = false;
|
bool ret = _phy->endpoint_add(endpoint, max_packet_size, type);
|
||||||
if (_phy->endpoint_add(endpoint, max_packet_size, type)) {
|
if (ret) {
|
||||||
info->callback = callback;
|
info->callback = callback;
|
||||||
info->flags |= ENDPOINT_ENABLED;
|
info->flags |= ENDPOINT_ENABLED;
|
||||||
info->pending = 0;
|
info->pending = 0;
|
||||||
|
@ -1366,7 +1366,7 @@ bool USBDevice::read_start(usb_ep_t endpoint, uint8_t *buffer, uint32_t max_size
|
||||||
|
|
||||||
unlock();
|
unlock();
|
||||||
|
|
||||||
return true;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t USBDevice::read_finish(usb_ep_t endpoint)
|
uint32_t USBDevice::read_finish(usb_ep_t endpoint)
|
||||||
|
|
Loading…
Reference in New Issue