rename board specific macro for example
- BOARD_DEVICE/HOST_RHPORT_NUM to BOARD_TUD/H_RHPORT - BOARD_DEVICE/HOST_RHPORT_SPEED to BOARD_TUD/H_MAX_SPEED
This commit is contained in:
@@ -40,13 +40,13 @@
|
||||
#endif
|
||||
|
||||
// RHPort number used for device can be defined by board.mk, default to port 0
|
||||
#ifndef BOARD_DEVICE_RHPORT_NUM
|
||||
#define BOARD_DEVICE_RHPORT_NUM 0
|
||||
#ifndef BOARD_TUD_RHPORT
|
||||
#define BOARD_TUD_RHPORT 0
|
||||
#endif
|
||||
|
||||
// RHPort number used for device can be defined by board.mk, default to port 1
|
||||
#ifndef BOARD_HOST_RHPORT_NUM
|
||||
#define BOARD_HOST_RHPORT_NUM 1
|
||||
#ifndef BOARD_TUH_RHPORT
|
||||
#define BOARD_TUH_RHPORT 1
|
||||
#endif
|
||||
|
||||
// Use raspberry pio-usb for host
|
||||
@@ -54,42 +54,42 @@
|
||||
|
||||
// RHPort max operational speed can defined by board.mk
|
||||
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
|
||||
#ifndef BOARD_DEVICE_RHPORT_SPEED
|
||||
#ifndef BOARD_TUD_MAX_SPEED
|
||||
#if TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX, OPT_MCU_MIMXRT10XX, OPT_MCU_NUC505) ||\
|
||||
TU_CHECK_MCU(OPT_MCU_CXD56, OPT_MCU_SAMX7X, OPT_MCU_BCM2711) ||\
|
||||
TU_CHECK_MCU(OPT_MCU_FT90X, OPT_MCU_FT93X)
|
||||
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
|
||||
#define BOARD_TUD_MAX_SPEED OPT_MODE_HIGH_SPEED
|
||||
#else
|
||||
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
|
||||
#define BOARD_TUD_MAX_SPEED OPT_MODE_FULL_SPEED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// RHPort max operational speed can defined by board.mk
|
||||
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
|
||||
#ifndef BOARD_HOST_RHPORT_SPEED
|
||||
#ifndef BOARD_TUH_MAX_SPEED
|
||||
#if TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX, OPT_MCU_MIMXRT10XX, OPT_MCU_NUC505) ||\
|
||||
TU_CHECK_MCU(OPT_MCU_CXD56, OPT_MCU_SAMX7X, OPT_MCU_BCM2711) ||\
|
||||
TU_CHECK_MCU(OPT_MCU_FT90X, OPT_MCU_FT93X)
|
||||
#define BOARD_HOST_RHPORT_SPEED OPT_MODE_HIGH_SPEED
|
||||
#define BOARD_TUH_MAX_SPEED OPT_MODE_HIGH_SPEED
|
||||
#else
|
||||
#define BOARD_HOST_RHPORT_SPEED OPT_MODE_FULL_SPEED
|
||||
#define BOARD_TUH_MAX_SPEED OPT_MODE_FULL_SPEED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Device mode with rhport and speed defined by board.mk
|
||||
#if BOARD_DEVICE_RHPORT_NUM == 0
|
||||
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
|
||||
#elif BOARD_DEVICE_RHPORT_NUM == 1
|
||||
#define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
|
||||
#if BOARD_TUD_RHPORT == 0
|
||||
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_TUD_MAX_SPEED)
|
||||
#elif BOARD_TUD_RHPORT == 1
|
||||
#define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_TUD_MAX_SPEED)
|
||||
#else
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
||||
// Device mode with rhport and speed defined by board.mk
|
||||
#if BOARD_HOST_RHPORT_NUM == 0
|
||||
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_HOST | BOARD_HOST_RHPORT_SPEED)
|
||||
#elif BOARD_HOST_RHPORT_NUM == 1
|
||||
#define CFG_TUSB_RHPORT1_MODE (OPT_MODE_HOST | BOARD_HOST_RHPORT_SPEED)
|
||||
#if BOARD_TUH_RHPORT == 0
|
||||
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_HOST | BOARD_TUH_MAX_SPEED)
|
||||
#elif BOARD_TUH_RHPORT == 1
|
||||
#define CFG_TUSB_RHPORT1_MODE (OPT_MODE_HOST | BOARD_TUH_MAX_SPEED)
|
||||
#else
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user