From bf8b60bc93fd3f5e24a12f1069794aff9f6fc2f2 Mon Sep 17 00:00:00 2001 From: HiFiPhile Date: Sat, 6 Apr 2024 19:27:00 +0200 Subject: [PATCH] WIP --- src/portable/synopsys/dwc2/dcd_dwc2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/portable/synopsys/dwc2/dcd_dwc2.c b/src/portable/synopsys/dwc2/dcd_dwc2.c index 8c904fe895..baaedbcd5e 100644 --- a/src/portable/synopsys/dwc2/dcd_dwc2.c +++ b/src/portable/synopsys/dwc2/dcd_dwc2.c @@ -207,7 +207,7 @@ static void dma_ep0_start(uint8_t rhport) dwc2->epout[0].doeptsiz = (3 << DOEPTSIZ_STUPCNT_Pos); dwc2->epout[0].doeptsiz |= (3 * 8); dwc2->epout[0].doeptsiz |= (1 << DOEPTSIZ_PKTCNT_Pos); - dwc2->epout[0].doepdma = (uint32_t)_setup_packet; + dwc2->epout[0].doepdma = (uintptr_t)_setup_packet; dwc2->epout[0].doepctl |= DOEPCTL_EPENA | DOEPCTL_USBAEP; } @@ -1063,12 +1063,13 @@ static void handle_epout_irq(uint8_t rhport) { // STPKTRX is only available for version from 3_00a if ((doepint & DOEPINT_STPKTRX) && (dwc2->gsnpsid >= DWC2_CORE_REV_3_00a)) { clear_flag |= DOEPINT_STPKTRX; - if(dma_supported(rhport)) { - dma_ep0_start(rhport); - } } - epout->doepint = clear_flag; + + if(dma_supported(rhport) && (dwc2->gsnpsid >= DWC2_CORE_REV_3_00a)) { + dma_ep0_start(rhport); + } + dcd_event_setup_received(rhport, (uint8_t*) _setup_packet, true); }