Skip to content

Commit

Permalink
dcd_da1469x: Re-enable RX after resume
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kasjer committed Jan 20, 2022
1 parent ae4d901 commit 7b07836
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/portable/dialog/da146xx/dcd_da146xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 7b07836

Please sign in to comment.