From 5fde071509ee80999804255001c5b2d4f473ed94 Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Mon, 25 Jun 2018 17:48:53 -0500 Subject: [PATCH] Implement endpoint_abort for STM32 Make use of the added function HAL_PCD_EP_Abort to implement endpoint_abort. --- usb/device/targets/TARGET_STM/USBPhy_STM32.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp b/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp index 5bb99c5b01..33a80921f2 100644 --- a/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp +++ b/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp @@ -475,7 +475,8 @@ bool USBPhyHw::endpoint_write(usb_ep_t endpoint, uint8_t *data, uint32_t size) 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 = HAL_PCD_EP_Abort(&hpcd, endpoint); + MBED_ASSERT(ret==HAL_OK); } void USBPhyHw::process()