diff --git a/src/portable/synopsys/dwc2/dwc2_gd32f.h b/src/portable/synopsys/dwc2/dwc2_gd32f.h index 64bb363fcc..aad14362c6 100644 --- a/src/portable/synopsys/dwc2/dwc2_gd32f.h +++ b/src/portable/synopsys/dwc2/dwc2_gd32f.h @@ -63,16 +63,32 @@ extern uint32_t SystemCoreClock; TU_ATTR_ALWAYS_INLINE static inline void dwc2_dcd_int_enable(uint8_t rhport) { - (void)rhport; - NVIC_EnableIRQ(RHPORT_IRQn); - // NVIC_EnableIRQ(USBHS_WKUP_IRQn); + switch (rhport) { + case 0: + NVIC_EnableIRQ(USBFS_IRQn); + NVIC_EnableIRQ(USBFS_WKUP_IRQn); + break; + + case 1: + NVIC_EnableIRQ(USBHS_IRQn); + NVIC_EnableIRQ(USBHS_WKUP_IRQn); + break; + } } TU_ATTR_ALWAYS_INLINE static inline void dwc2_dcd_int_disable(uint8_t rhport) { - (void)rhport; - NVIC_DisableIRQ(RHPORT_IRQn); - // NVIC_DisableIRQ(USBHS_WKUP_IRQn); + switch (rhport) { + case 0: + NVIC_DisableIRQ(USBFS_IRQn); + NVIC_DisableIRQ(USBFS_WKUP_IRQn); + break; + + case 1: + NVIC_DisableIRQ(USBHS_IRQn); + NVIC_DisableIRQ(USBHS_WKUP_IRQn); + break; + } } TU_ATTR_ALWAYS_INLINE