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.
This commit is contained in:
Jerzy Kasenberg 2022-01-20 09:58:40 +01:00 committed by Jerzy Kasenberg
parent ae4d901d83
commit 7b078367e8
1 changed files with 9 additions and 0 deletions

View File

@ -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);
}
}