mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
rusb2: move dynamic irq function to c file
This commit is contained in:
parent
789e478d4d
commit
965627e81c
@ -114,8 +114,9 @@ function(family_configure_example TARGET RTOS)
|
||||
# Add TinyUSB target and port source
|
||||
family_add_tinyusb(${TARGET} OPT_MCU_RAXXX ${RTOS})
|
||||
target_sources(${TARGET}-tinyusb PUBLIC
|
||||
${TOP}/src/portable/renesas/rusb2/dcd_rusb2.c
|
||||
${TOP}/src/portable/renesas/rusb2/hcd_rusb2.c
|
||||
${TOP}/src/portable/renesas/rusb2/dcd_rusb2.c
|
||||
${TOP}/src/portable/renesas/rusb2/hcd_rusb2.c
|
||||
${TOP}/src/portable/renesas/rusb2/rusb2_ra.c
|
||||
)
|
||||
target_link_libraries(${TARGET}-tinyusb PUBLIC board_${BOARD})
|
||||
|
||||
|
@ -32,6 +32,7 @@ endif
|
||||
SRC_C += \
|
||||
src/portable/renesas/rusb2/dcd_rusb2.c \
|
||||
src/portable/renesas/rusb2/hcd_rusb2.c \
|
||||
src/portable/renesas/rusb2/rusb2_ra.c \
|
||||
$(FSP_RA)/src/bsp/cmsis/Device/RENESAS/Source/startup.c \
|
||||
$(FSP_RA)/src/bsp/cmsis/Device/RENESAS/Source/system.c \
|
||||
$(FSP_RA)/src/bsp/mcu/all/bsp_clocks.c \
|
||||
|
@ -50,11 +50,6 @@
|
||||
#define D0FIFOCTR_b CFIFOCTR_b
|
||||
#endif
|
||||
|
||||
// Application API for setting IRQ number
|
||||
void tud_rusb2_set_irqnum(uint8_t rhport, int32_t irqnum) {
|
||||
rusb2_controller[rhport].irqnum = irqnum;
|
||||
}
|
||||
|
||||
#else
|
||||
#error "Unsupported MCU"
|
||||
#endif
|
||||
|
16
src/portable/renesas/rusb2/rusb2_ra.c
Normal file
16
src/portable/renesas/rusb2/rusb2_ra.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include "tusb_option.h"
|
||||
#include "device/dcd.h"
|
||||
#include "rusb2_type.h"
|
||||
#include "rusb2_ra.h"
|
||||
|
||||
rusb2_controller_t rusb2_controller[] = {
|
||||
{ .reg_base = R_USB_FS0_BASE, .irqnum = USBFS_INT_IRQn },
|
||||
#ifdef RUSB2_SUPPORT_HIGHSPEED
|
||||
{ .reg_base = R_USB_HS0_BASE, .irqnum = USBHS_USB_INT_RESUME_IRQn },
|
||||
#endif
|
||||
};
|
||||
|
||||
// Application API for setting IRQ number
|
||||
void tud_rusb2_set_irqnum(uint8_t rhport, int32_t irqnum) {
|
||||
rusb2_controller[rhport].irqnum = irqnum;
|
||||
}
|
@ -74,14 +74,7 @@ typedef struct {
|
||||
#define rusb2_is_highspeed_reg(_reg) (false)
|
||||
#endif
|
||||
|
||||
// USBFS_INT_IRQn and USBHS_USB_INT_RESUME_IRQn are generated by FSP
|
||||
static rusb2_controller_t rusb2_controller[] = {
|
||||
{ .reg_base = R_USB_FS0_BASE, .irqnum = USBFS_INT_IRQn },
|
||||
#ifdef RUSB2_SUPPORT_HIGHSPEED
|
||||
{ .reg_base = R_USB_HS0_BASE, .irqnum = USBHS_USB_INT_RESUME_IRQn },
|
||||
#endif
|
||||
};
|
||||
|
||||
extern rusb2_controller_t rusb2_controller[];
|
||||
#define RUSB2_REG(_p) ((rusb2_reg_t*) rusb2_controller[_p].reg_base)
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
Loading…
x
Reference in New Issue
Block a user