more clean up

This commit is contained in:
hathach 2019-11-22 12:26:40 +07:00
parent ccb09db3b7
commit 2ead26a12d
1 changed files with 7 additions and 5 deletions

View File

@ -38,11 +38,11 @@
#if CFG_TUSB_MCU == OPT_MCU_RT10XX #if CFG_TUSB_MCU == OPT_MCU_RT10XX
#include "fsl_device_registers.h" #include "fsl_device_registers.h"
#define DCD_REGS_BASE { (dcd_registers_t*) USB1_BASE, (dcd_registers_t*) USB2_BASE }
#else #else
#include "chip.h" #include "chip.h"
#define DCD_REGS_BASE { (dcd_registers_t*) LPC_USB0_BASE, (dcd_registers_t*) LPC_USB1_BASE }
// Register base to CAPLENGTH
#define DCD_REGS_BASE { (dcd_registers_t*) (LPC_USB0_BASE + 0x100), (dcd_registers_t*) (LPC_USB1_BASE + 0x100) }
#endif #endif
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
@ -84,9 +84,12 @@ enum {
PORTSC_SUSPEND = TU_BIT(7) PORTSC_SUSPEND = TU_BIT(7)
}; };
// Device Register starting with CAPLENGTH offset // Device Registers
typedef struct typedef struct
{ {
//------------- ID + HW Parameter Registers-------------//
__I uint32_t TU_RESERVED[64]; ///< For iMX RT10xx, but not used by LPC18XX/LPC43XX
//------------- Capability Registers-------------// //------------- Capability Registers-------------//
__I uint8_t CAPLENGTH; ///< Capability Registers Length __I uint8_t CAPLENGTH; ///< Capability Registers Length
__I uint8_t TU_RESERVED[1]; __I uint8_t TU_RESERVED[1];
@ -204,7 +207,6 @@ typedef struct {
}dcd_data_t; }dcd_data_t;
static dcd_data_t _dcd_data CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(2048); static dcd_data_t _dcd_data CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(2048);
//static LPC_USBHS_T * const LPC_USB[2] = { LPC_USB0, LPC_USB1 };
static dcd_registers_t* DCD_REGS[] = DCD_REGS_BASE; static dcd_registers_t* DCD_REGS[] = DCD_REGS_BASE;
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+