From 0bdeb0450e3065942467723f605798bb6aa882d5 Mon Sep 17 00:00:00 2001 From: Maciej Bocianski Date: Mon, 23 Apr 2018 11:54:50 +0200 Subject: [PATCH] USBDevice: endpoint_add/read_start functions return value fix --- usb/device/USBDevice/USBDevice.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usb/device/USBDevice/USBDevice.cpp b/usb/device/USBDevice/USBDevice.cpp index 393c51133d..fdc49a83ea 100644 --- a/usb/device/USBDevice/USBDevice.cpp +++ b/usb/device/USBDevice/USBDevice.cpp @@ -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(max_packet_size <= 1024); - bool ret = false; - if (_phy->endpoint_add(endpoint, max_packet_size, type)) { + bool ret = _phy->endpoint_add(endpoint, max_packet_size, type); + if (ret) { info->callback = callback; info->flags |= ENDPOINT_ENABLED; info->pending = 0; @@ -1366,7 +1366,7 @@ bool USBDevice::read_start(usb_ep_t endpoint, uint8_t *buffer, uint32_t max_size unlock(); - return true; + return ret; } uint32_t USBDevice::read_finish(usb_ep_t endpoint)