From 7b078367e82fae8ef4ec094f6db9e584db82f06a Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Thu, 20 Jan 2022 09:58:40 +0100 Subject: [PATCH] dcd_da1469x: Re-enable RX after resume Going to suspend states disable reception on non-0 RX endpoints. Now when USB resume condition is detected, all RX endpoints with pending transfers are resumed. --- src/portable/dialog/da146xx/dcd_da146xx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/portable/dialog/da146xx/dcd_da146xx.c b/src/portable/dialog/da146xx/dcd_da146xx.c index 5713f5cc..02fad816 100644 --- a/src/portable/dialog/da146xx/dcd_da146xx.c +++ b/src/portable/dialog/da146xx/dcd_da146xx.c @@ -733,6 +733,15 @@ static void handle_alt_ev(void) set_nfsr(NFSR_NODE_OPERATIONAL); USB->USB_ALTMSK_REG = USB_USB_ALTMSK_REG_USB_M_RESET_Msk | USB_USB_ALTMSK_REG_USB_M_SD3_Msk; + // Re-enable reception of endpoint with pending transfer + for (int epnum = 1; epnum <= 3; ++epnum) + { + xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, TUSB_DIR_OUT); + if (xfer->total_len > xfer->transferred) + { + start_rx_packet(xfer); + } + } dcd_event_bus_signal(0, DCD_EVENT_RESUME, true); } }