diff options
| author | sakumisu <[email protected]> | 2026-02-03 20:46:59 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2026-02-03 20:48:35 +0800 |
| commit | 64dced8ec74a4d10952c0005f947736a4bf6ef9a (patch) | |
| tree | 62ec5613edca17d727cabebc1eff3163d8c48856 | |
| parent | eaefb8ed21ed23f732e8b608ed7948e6b71ab0d8 (diff) | |
fix(port/dwc2/usb_dc_dwc2): fix typo for disable global isr
Signed-off-by: sakumisu <[email protected]>
| -rw-r--r-- | port/dwc2/usb_dc_dwc2.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/port/dwc2/usb_dc_dwc2.c b/port/dwc2/usb_dc_dwc2.c index 31be0d55..7e0c82ce 100644 --- a/port/dwc2/usb_dc_dwc2.c +++ b/port/dwc2/usb_dc_dwc2.c @@ -616,7 +616,7 @@ int usb_dc_init(uint8_t busid) int usb_dc_deinit(uint8_t busid) { - USB_OTG_GLB->GAHBCFG |= USB_OTG_GAHBCFG_GINT; + USB_OTG_GLB->GAHBCFG &= ~USB_OTG_GAHBCFG_GINT; USB_OTG_DEV->DCTL |= USB_OTG_DCTL_SDIS; /* Clear Pending interrupt */ @@ -630,6 +630,11 @@ int usb_dc_deinit(uint8_t busid) USB_OTG_DEV->DOEPMSK = 0U; USB_OTG_DEV->DAINTMSK = 0U; + /* Disable all interrupts. */ + USB_OTG_GLB->GINTMSK = 0U; + /* Clear any pending interrupts */ + USB_OTG_GLB->GINTSTS = 0xBFFFFFFFU; + /* Flush the FIFO */ dwc2_flush_txfifo(busid, 0x10U); dwc2_flush_rxfifo(busid); |
