add new tusb_int_handler(rhport, in_isr) as common irq handler
update tusb_init() to take rhport and role, defined as macro with optional argument for backward compatible
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
set(MCU_VARIANT MIMXRT1062)
|
||||
|
||||
set(JLINK_DEVICE MIMXRT1062xxx6A)
|
||||
#set(JLINK_OPTION "-USB 000726129165")
|
||||
set(PYOCD_TARGET mimxrt1060)
|
||||
set(NXPLINK_DEVICE MIMXRT1062xxxxA:EVK-MIMXRT1060)
|
||||
|
||||
|
@@ -46,18 +46,6 @@
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#if defined(BOARD_TUD_RHPORT) && CFG_TUD_ENABLED
|
||||
#define PORT_SUPPORT_DEVICE(_n) (BOARD_TUD_RHPORT == _n)
|
||||
#else
|
||||
#define PORT_SUPPORT_DEVICE(_n) 0
|
||||
#endif
|
||||
|
||||
#if defined(BOARD_TUH_RHPORT) && CFG_TUH_ENABLED
|
||||
#define PORT_SUPPORT_HOST(_n) (BOARD_TUH_RHPORT == _n)
|
||||
#else
|
||||
#define PORT_SUPPORT_HOST(_n) 0
|
||||
#endif
|
||||
|
||||
// needed by fsl_flexspi_nor_boot
|
||||
TU_ATTR_USED const uint8_t dcd_data[] = { 0x00 };
|
||||
|
||||
@@ -156,23 +144,11 @@ void board_init(void)
|
||||
// USB Interrupt Handler
|
||||
//--------------------------------------------------------------------+
|
||||
void USB_OTG1_IRQHandler(void) {
|
||||
#if PORT_SUPPORT_DEVICE(0)
|
||||
tud_int_handler(0);
|
||||
#endif
|
||||
|
||||
#if PORT_SUPPORT_HOST(0)
|
||||
tuh_int_handler(0, true);
|
||||
#endif
|
||||
tusb_int_handler(0, true);
|
||||
}
|
||||
|
||||
void USB_OTG2_IRQHandler(void) {
|
||||
#if PORT_SUPPORT_DEVICE(1)
|
||||
tud_int_handler(1);
|
||||
#endif
|
||||
|
||||
#if PORT_SUPPORT_HOST(1)
|
||||
tuh_int_handler(1, true);
|
||||
#endif
|
||||
tusb_int_handler(1, true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
Reference in New Issue
Block a user