summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Silva <[email protected]>2022-03-21 15:59:08 +0000
committerRafael Silva <[email protected]>2022-06-02 09:35:30 +0100
commite0220c6594f08d5b402994f92c12fc92482e9115 (patch)
treeb04105e3cf03fc56c9bb3af1a6a7dfe52e2d79de
parentc529d0b4405aa33b4793d03ce82568990c3f507c (diff)
fix int handling for host in ek_ra4m3 port
-rw-r--r--hw/bsp/ra/boards/ek_ra4m3/ek_ra4m3.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/hw/bsp/ra/boards/ek_ra4m3/ek_ra4m3.c b/hw/bsp/ra/boards/ek_ra4m3/ek_ra4m3.c
index d79d7b425..c2f2a0903 100644
--- a/hw/bsp/ra/boards/ek_ra4m3/ek_ra4m3.c
+++ b/hw/bsp/ra/boards/ek_ra4m3/ek_ra4m3.c
@@ -91,28 +91,52 @@ void usbfs_interrupt_handler(void)
IRQn_Type irq = R_FSP_CurrentIrqGet();
R_BSP_IrqStatusClear(irq);
+#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
+ tuh_int_handler(0);
+#endif
+
+#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
tud_int_handler(0);
+#endif
}
void usbfs_resume_handler(void)
{
IRQn_Type irq = R_FSP_CurrentIrqGet();
R_BSP_IrqStatusClear(irq);
+#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
+ tuh_int_handler(0);
+#endif
+
+#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
tud_int_handler(0);
+#endif
}
void usbfs_d0fifo_handler(void)
{
IRQn_Type irq = R_FSP_CurrentIrqGet();
R_BSP_IrqStatusClear(irq);
+#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
+ tuh_int_handler(0);
+#endif
+
+#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
tud_int_handler(0);
+#endif
}
void usbfs_d1fifo_handler(void)
{
IRQn_Type irq = R_FSP_CurrentIrqGet();
R_BSP_IrqStatusClear(irq);
+#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
+ tuh_int_handler(0);
+#endif
+
+#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
tud_int_handler(0);
+#endif
}
void board_init(void)
@@ -125,17 +149,17 @@ void board_init(void)
R_MSTP->MSTPCRB &= ~(1U << 11U);
R_SYSTEM->PRCR = (uint16_t) BSP_PRV_PRCR_LOCK;
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(TU_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USBFS_RESUME_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USBFS_FIFO_0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USBFS_FIFO_1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
+#if CFG_TUSB_OS == OPT_OS_FREERTOS
+ // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
+ NVIC_SetPriority(TU_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
+ NVIC_SetPriority(USBFS_RESUME_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
+ NVIC_SetPriority(USBFS_FIFO_0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
+ NVIC_SetPriority(USBFS_FIFO_1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
#endif
#if CFG_TUSB_OS == OPT_OS_NONE
/* Init systick */
- SysTick_Config(SystemCoreClock / 1000);
+ SysTick_Config(SystemCoreClock / 1000);
#endif
}