diff options
| author | Jerzy Kasenberg <[email protected]> | 2020-08-12 10:18:11 +0200 |
|---|---|---|
| committer | Jerzy Kasenberg <[email protected]> | 2020-08-12 10:26:36 +0200 |
| commit | 88c5e2a37ffee3d82107076642b64227cd66dc17 (patch) | |
| tree | 76bcaa12198ed8f644694fdc7c6107440835c351 /src | |
| parent | b0f617ba209110a4d5f144f46ccfc9f2cbfa25e7 (diff) | |
Fix synopsys fifo flush during stall
Wrong FIFO was flushed in dcd_edpt_stall().
(epnum - 1) should only be used when accessing DIEPTXF registers.
For DIEPCTL and GRSTCTL epnum is correct index.
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/st/synopsys/dcd_synopsys.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/portable/st/synopsys/dcd_synopsys.c b/src/portable/st/synopsys/dcd_synopsys.c index 3c349582f..aaf586ed0 100644 --- a/src/portable/st/synopsys/dcd_synopsys.c +++ b/src/portable/st/synopsys/dcd_synopsys.c @@ -667,7 +667,7 @@ void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr) } // Flush the FIFO, and wait until we have confirmed it cleared. - usb_otg->GRSTCTL |= ((epnum - 1) << USB_OTG_GRSTCTL_TXFNUM_Pos); + usb_otg->GRSTCTL |= (epnum << USB_OTG_GRSTCTL_TXFNUM_Pos); usb_otg->GRSTCTL |= USB_OTG_GRSTCTL_TXFFLSH; while((usb_otg->GRSTCTL & USB_OTG_GRSTCTL_TXFFLSH_Msk) != 0); } else { |
