From b2ae05f991b181a95247fe72bf3100328243e175 Mon Sep 17 00:00:00 2001 From: George Beckstein Date: Thu, 14 Mar 2019 22:08:29 -0400 Subject: [PATCH] Fixed some comments --- .../targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhyHw.h | 2 +- .../TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhyHw.h b/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhyHw.h index 918688e38e..3cf7ebf89b 100644 --- a/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhyHw.h +++ b/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhyHw.h @@ -94,7 +94,7 @@ private: // Nordic transfer structures for each in/out endpoint nrf_drv_usbd_transfer_t transfer_buf[18]; - // Returns the appropraite transfer structure buffer for the given endpoint + // Returns the appropriate transfer structure buffer for the given endpoint nrf_drv_usbd_transfer_t* get_transfer_buffer(usb_ep_t endpoint); // Returns the corresponding enumeration given an mbed endpoint number diff --git a/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp b/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp index b646f644f2..8a022674df 100644 --- a/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp +++ b/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp @@ -357,6 +357,13 @@ void USBPhyHw::endpoint_stall(usb_ep_t endpoint) { void USBPhyHw::endpoint_unstall(usb_ep_t endpoint) { nrf_drv_usbd_ep_t ep = get_nordic_endpoint(endpoint); nrf_drv_usbd_ep_stall_clear(ep); + + /* + * This is a somewhat hacky fix to fully "unload" + * an IN endpoint after a buffer has been + * transferred via EasyDMA... + */ + nrf_drv_usbd_ep_disable(ep); nrf_drv_usbd_ep_enable(ep); }