drivers: usb_dc_nrfx: clear endpoint flags during ep_disable()

If a loaded endpoint was disabled and then reconfigured,
it is not possible to start an IN transfer and
usb_dc_ep_write() returns -EAGAIN.

Call ep_ctx_reset() to clear endpoint operations flags
and reset buffer after endpoint is disabled.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2021-04-19 15:42:30 +02:00 committed by Carles Cufí
commit 583334b606

View file

@ -1598,6 +1598,11 @@ int usb_dc_ep_disable(const uint8_t ep)
LOG_DBG("EP disable: 0x%02x", ep);
nrfx_usbd_ep_disable(ep_addr_to_nrfx(ep));
/* Clear write_in_progress as nrfx_usbd_ep_disable()
* terminates endpoint transaction.
*/
ep_ctx->write_in_progress = false;
ep_ctx_reset(ep_ctx);
ep_ctx->cfg.en = false;
return 0;