Merge pull request #3319 from peppapighs/dwc2-usbsuspm

dcd/dwc2: fix suspend interrupt indefinitely disabled on AT32F405
This commit is contained in:
Zixun LI 2025-10-25 23:11:26 +02:00 committed by GitHub
commit a6efc7d722
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 42 additions and 39 deletions

View File

@ -1054,6 +1054,8 @@ void dcd_int_handler(uint8_t rhport) {
if (gintsts & GINTSTS_ENUMDNE) {
// ENUMDNE is the end of reset where speed of the link is detected
dwc2->gintsts = GINTSTS_ENUMDNE;
// There may be a pending suspend event, so we clear it first
dwc2->gintsts = GINTSTS_USBSUSP;
dwc2->gintmsk |= GINTMSK_USBSUSPM;
handle_enum_done(rhport);
}

View File

@ -84,7 +84,8 @@
}
}
TU_ATTR_ALWAYS_INLINE static inline void dwc2_dcd_int_enable(uint8_t rhport) { NVIC_EnableIRQ(_dwc2_controller[rhport].irqnum);
TU_ATTR_ALWAYS_INLINE static inline void dwc2_dcd_int_enable(uint8_t rhport) {
NVIC_EnableIRQ(_dwc2_controller[rhport].irqnum);
}
TU_ATTR_ALWAYS_INLINE static inline void dwc2_dcd_int_disable(uint8_t rhport) {
@ -118,4 +119,4 @@
}
#endif
#endif /* DWC2_GD32_H_ */
#endif /* DWC2_AT32_H_ */