@@ -91,28 +91,52 @@ void usbfs_interrupt_handler(void)
91
91
IRQn_Type irq = R_FSP_CurrentIrqGet ();
92
92
R_BSP_IrqStatusClear (irq );
93
93
94
+ #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
95
+ tuh_int_handler (0 );
96
+ #endif
97
+
98
+ #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
94
99
tud_int_handler (0 );
100
+ #endif
95
101
}
96
102
void usbfs_resume_handler (void )
97
103
{
98
104
IRQn_Type irq = R_FSP_CurrentIrqGet ();
99
105
R_BSP_IrqStatusClear (irq );
100
106
107
+ #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
108
+ tuh_int_handler (0 );
109
+ #endif
110
+
111
+ #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
101
112
tud_int_handler (0 );
113
+ #endif
102
114
}
103
115
void usbfs_d0fifo_handler (void )
104
116
{
105
117
IRQn_Type irq = R_FSP_CurrentIrqGet ();
106
118
R_BSP_IrqStatusClear (irq );
107
119
120
+ #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
121
+ tuh_int_handler (0 );
122
+ #endif
123
+
124
+ #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
108
125
tud_int_handler (0 );
126
+ #endif
109
127
}
110
128
void usbfs_d1fifo_handler (void )
111
129
{
112
130
IRQn_Type irq = R_FSP_CurrentIrqGet ();
113
131
R_BSP_IrqStatusClear (irq );
114
132
133
+ #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
134
+ tuh_int_handler (0 );
135
+ #endif
136
+
137
+ #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
115
138
tud_int_handler (0 );
139
+ #endif
116
140
}
117
141
118
142
void board_init (void )
@@ -125,17 +149,17 @@ void board_init(void)
125
149
R_MSTP -> MSTPCRB &= ~(1U << 11U );
126
150
R_SYSTEM -> PRCR = (uint16_t ) BSP_PRV_PRCR_LOCK ;
127
151
128
- #if CFG_TUSB_OS == OPT_OS_FREERTOS
129
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
130
- NVIC_SetPriority (TU_IRQn , configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
131
- NVIC_SetPriority (USBFS_RESUME_IRQn , configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
132
- NVIC_SetPriority (USBFS_FIFO_0_IRQn , configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
133
- NVIC_SetPriority (USBFS_FIFO_1_IRQn , configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
152
+ #if CFG_TUSB_OS == OPT_OS_FREERTOS
153
+ // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
154
+ NVIC_SetPriority (TU_IRQn , configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
155
+ NVIC_SetPriority (USBFS_RESUME_IRQn , configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
156
+ NVIC_SetPriority (USBFS_FIFO_0_IRQn , configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
157
+ NVIC_SetPriority (USBFS_FIFO_1_IRQn , configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
134
158
#endif
135
159
136
160
#if CFG_TUSB_OS == OPT_OS_NONE
137
161
/* Init systick */
138
- SysTick_Config (SystemCoreClock / 1000 );
162
+ SysTick_Config (SystemCoreClock / 1000 );
139
163
#endif
140
164
}
141
165
0 commit comments