drivers: usb_dc_mcux_ehci: re-enable reception after clear stall

Re-enable reception after clear an endpoint stall.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
Johann Fischer 2019-12-04 13:58:41 +01:00 committed by Carles Cufí
commit 085e58faf8

View file

@ -266,6 +266,20 @@ int usb_dc_ep_clear_stall(const u8_t ep)
return -EIO;
}
if ((EP_ADDR2IDX(ep) != USB_CONTROL_ENDPOINT) &&
(EP_ADDR2DIR(ep) == USB_EP_DIR_OUT)) {
status = dev_data.interface->deviceRecv(
dev_data.controllerHandle, ep,
(u8_t *)dev_data.eps[ep_abs_idx].block.data,
(uint32_t)dev_data.eps[ep_abs_idx].ep_mps);
if (kStatus_USB_Success != status) {
LOG_ERR("Failed to enable reception on 0x%02x", ep);
return -EIO;
}
dev_data.eps[ep_abs_idx].ep_occupied = true;
}
return 0;
}