Răsfoiți Sursa

grstctl set fifo + flush in one assign

hathach 3 ani în urmă
părinte
comite
6e7cd220dc
1 a modificat fișierele cu 1 adăugiri și 2 ștergeri
  1. 1 2
      src/portable/synopsys/dwc2/dcd_dwc2.c

+ 1 - 2
src/portable/synopsys/dwc2/dcd_dwc2.c

@@ -796,8 +796,7 @@ static void dcd_edpt_disable (uint8_t rhport, uint8_t ep_addr, bool stall)
     }
 
     // Flush the FIFO, and wait until we have confirmed it cleared.
-    dwc2->grstctl = (epnum << GRSTCTL_TXFNUM_Pos);
-    dwc2->grstctl |= GRSTCTL_TXFFLSH;
+    dwc2->grstctl = ((epnum << GRSTCTL_TXFNUM_Pos) | GRSTCTL_TXFFLSH);
     while ( (dwc2->grstctl & GRSTCTL_TXFFLSH_Msk) != 0 ) {}
   }
   else