diff options
| author | Ha Thach <[email protected]> | 2024-04-08 12:30:25 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-08 12:30:25 +0700 |
| commit | af1346c74878aaec8549483ae6371614f550c863 (patch) | |
| tree | 7cb60fe7130e66839019bc43bf7c7385f926c155 /src/portable | |
| parent | ffab7bf9dde0c0e960feeb5c1264823ca5a0ced7 (diff) | |
| parent | d6d8acad90c8a1578dcbd886154fbb3f2bd1a363 (diff) | |
Merge pull request #2466 from wavenumber-eng/MCX
TinyUSB stack ported to MCXA and MXCN freedom boards.
Diffstat (limited to 'src/portable')
| -rw-r--r-- | src/portable/chipidea/ci_fs/ci_fs_mcx.h | 25 | ||||
| -rw-r--r-- | src/portable/chipidea/ci_fs/dcd_ci_fs.c | 2 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/portable/chipidea/ci_fs/ci_fs_mcx.h b/src/portable/chipidea/ci_fs/ci_fs_mcx.h index 3bfcd398e..4b93a03a7 100644 --- a/src/portable/chipidea/ci_fs/ci_fs_mcx.h +++ b/src/portable/chipidea/ci_fs/ci_fs_mcx.h @@ -29,19 +29,28 @@ #include "fsl_device_registers.h" -#define CI_FS_REG(_port) ((ci_fs_regs_t*) USBFS0_BASE) -#define CI_REG CI_FS_REG(0) +#if CFG_TUSB_MCU == OPT_MCU_MCXN9 + #define CI_FS_REG(_port) ((ci_fs_regs_t*) USBFS0_BASE) + #define CIFS_IRQN USB0_FS_IRQn -void dcd_int_enable(uint8_t rhport) -{ +#elif CFG_TUSB_MCU == OPT_MCU_MCXA15 + #define CI_FS_REG(_port) ((ci_fs_regs_t*) USB0_BASE) + #define CIFS_IRQN USB0_IRQn + +#else + #error "MCU is not supported" +#endif + +#define CI_REG CI_FS_REG(0) + +void dcd_int_enable(uint8_t rhport) { (void) rhport; - NVIC_EnableIRQ(USB0_FS_IRQn); + NVIC_EnableIRQ(CIFS_IRQN); } -void dcd_int_disable(uint8_t rhport) -{ +void dcd_int_disable(uint8_t rhport) { (void) rhport; - NVIC_DisableIRQ(USB0_FS_IRQn); + NVIC_DisableIRQ(CIFS_IRQN); } #endif diff --git a/src/portable/chipidea/ci_fs/dcd_ci_fs.c b/src/portable/chipidea/ci_fs/dcd_ci_fs.c index a68ecf8c9..02f813ab5 100644 --- a/src/portable/chipidea/ci_fs/dcd_ci_fs.c +++ b/src/portable/chipidea/ci_fs/dcd_ci_fs.c @@ -295,7 +295,7 @@ void dcd_init(uint8_t rhport) CI_REG->INT_EN = USB_INTEN_USBRSTEN_MASK; dcd_connect(rhport); - // NVIC_ClearPendingIRQ(USB0_IRQn); + // NVIC_ClearPendingIRQ(CIFS_IRQN); } void dcd_set_address(uint8_t rhport, uint8_t dev_addr) |
