Skip to content

Commit

Permalink
Fix proper USB interrupt handling per port
Browse files Browse the repository at this point in the history
- Depending on the used USB port / core the proper USB interrupt is used now
  • Loading branch information
RockyZeroFour committed May 1, 2024
1 parent fedcda8 commit f8708f0
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/portable/synopsys/dwc2/dwc2_gd32f.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,28 @@ 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);
break;

case 1:
NVIC_EnableIRQ(USBHS_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);
break;

case 1:
NVIC_DisableIRQ(USBHS_IRQn);
break;
}
}

TU_ATTR_ALWAYS_INLINE
Expand Down

0 comments on commit f8708f0

Please sign in to comment.