summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2026-01-22 21:05:15 +0800
committersakumisu <[email protected]>2026-01-22 21:05:15 +0800
commit0ca521a1d05bf87eb821f58d3a2d536712342605 (patch)
treed9b0f43611eec732a1f0a3c918ae58d46dbe7a93
parent309aa2ffd8dbcecd8b1ae793402a5e836c0dd955 (diff)
update(port/dwc2/usb_dc_dwc2): move read setup into USB_OTG_GINTSTS_ENUMDNE irq
Signed-off-by: sakumisu <[email protected]>
-rw-r--r--port/dwc2/usb_dc_dwc2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/port/dwc2/usb_dc_dwc2.c b/port/dwc2/usb_dc_dwc2.c
index 8e356a64..31be0d55 100644
--- a/port/dwc2/usb_dc_dwc2.c
+++ b/port/dwc2/usb_dc_dwc2.c
@@ -1173,14 +1173,15 @@ process_setup:
memset(g_dwc2_udc[busid].in_ep, 0, sizeof(struct dwc2_ep_state) * 16);
memset(g_dwc2_udc[busid].out_ep, 0, sizeof(struct dwc2_ep_state) * 16);
usbd_event_reset_handler(busid);
- /* Start reading setup */
- dwc2_ep0_start_read_setup(busid, (uint8_t *)&g_dwc2_udc[busid].setup);
}
if (gint_status & USB_OTG_GINTSTS_ENUMDNE) {
USB_OTG_GLB->GINTSTS = USB_OTG_GINTSTS_ENUMDNE;
dwc2_set_turnaroundtime(busid, usbd_dwc2_get_system_clock(), dwc2_get_devspeed(busid));
USB_OTG_DEV->DCTL |= USB_OTG_DCTL_CGINAK;
+
+ /* Start reading setup */
+ dwc2_ep0_start_read_setup(busid, (uint8_t *)&g_dwc2_udc[busid].setup);
}
if (gint_status & USB_OTG_GINTSTS_PXFR_INCOMPISOOUT) {
USB_OTG_GLB->GINTSTS = USB_OTG_GINTSTS_PXFR_INCOMPISOOUT;