summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-11-23 00:48:56 +0700
committerhathach <[email protected]>2019-11-23 00:48:56 +0700
commitd991466a8e45d03a8c95da894b2992b1b8a7d0b0 (patch)
tree4ecc1c291dd67464268675371c8c04f6bdbbc7db /src
parent4ecb07afc5012cbc93664cc1a57b15e2fe0aff20 (diff)
fix rt1010 rt1020 only has 1 usb controller, rt1050 rt1060 has 2
Diffstat (limited to 'src')
-rw-r--r--src/portable/nxp/transdimension/dcd_transdimension.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/portable/nxp/transdimension/dcd_transdimension.c b/src/portable/nxp/transdimension/dcd_transdimension.c
index cc85bb62c..2ec7ae51c 100644
--- a/src/portable/nxp/transdimension/dcd_transdimension.c
+++ b/src/portable/nxp/transdimension/dcd_transdimension.c
@@ -38,8 +38,17 @@
#if CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
#include "fsl_device_registers.h"
+
+// RT1010 and RT1020 only has 1 USB controller
+#if FSL_FEATURE_SOC_USBHS_COUNT == 1
+ #define DCD_REGS_BASE { (dcd_registers_t*) USB_BASE }
+ IRQn_Type DCD_IRQn[] = { USB_OTG1_IRQn };
+
+// RT1050, RT1060 has 2 USB controllers
+#else
#define DCD_REGS_BASE { (dcd_registers_t*) USB1_BASE, (dcd_registers_t*) USB2_BASE }
IRQn_Type DCD_IRQn[] = { USB_OTG1_IRQn, USB_OTG2_IRQn };
+#endif
#else
#include "chip.h"