From 4ce82d714a3820b1d96c983d2f62e1faef1b8bab Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Thu, 3 May 2018 18:07:02 -0500 Subject: [PATCH] Fix return code check in endpoint abort Assert that HAL_PCD_EP_Abort returns HAL_OK rather that something else. --- usb/device/targets/TARGET_STM/USBPhy_STM32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp b/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp index 472b2021f5..e8ab482f75 100644 --- a/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp +++ b/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp @@ -473,7 +473,7 @@ void USBPhyHw::endpoint_abort(usb_ep_t endpoint) // TODO - stop the current transfer on this endpoint and don't call the IN or OUT callback HAL_StatusTypeDef ret; ret = HAL_PCD_EP_Abort(&hpcd, endpoint); - MBED_ASSERT(ret!=HAL_OK); + MBED_ASSERT(ret==HAL_OK); return; }