Skip to content

Commit 1a39169

Browse files
committed
update(port/dwc2/usb_dc_dwc2): clear crst bit because some mcu cannot be self-clearing, refs:#276
1 parent 82a0d24 commit 1a39169

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

port/dwc2/usb_dc_dwc2.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,12 @@ static inline int dwc2_reset(uint8_t busid)
136136

137137
do {
138138
if (++count > 200000U) {
139-
return -1;
139+
break;
140140
}
141141
} while ((USB_OTG_GLB->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST);
142142

143+
USB_OTG_GLB->GRSTCTL &= ~USB_OTG_GRSTCTL_CSRST;
144+
143145
return 0;
144146
}
145147

0 commit comments

Comments
 (0)