Skip to content

Commit 5b7a01b

Browse files
authored
Merge pull request hathach#1350 from hathach/enhance-multipl-ports
Enhance rhports management
2 parents 13a4582 + 1482a41 commit 5b7a01b

File tree

112 files changed

+308
-480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+308
-480
lines changed

examples/device/audio_4_channel_mic/src/tusb_config.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ extern "C" {
3939
#error CFG_TUSB_MCU must be defined
4040
#endif
4141

42-
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
43-
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
44-
#else
4542
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
46-
#endif
4743

4844
#ifndef CFG_TUSB_OS
4945
#define CFG_TUSB_OS OPT_OS_NONE

examples/device/audio_test/src/tusb_config.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ extern "C" {
3939
#error CFG_TUSB_MCU must be defined
4040
#endif
4141

42-
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
43-
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
44-
#else
4542
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
46-
#endif
4743

4844
#ifndef CFG_TUSB_OS
4945
#define CFG_TUSB_OS OPT_OS_NONE

examples/device/cdc_dual_ports/src/tusb_config.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,9 @@
4545
#endif
4646

4747
// RHPort max operational speed can defined by board.mk
48-
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
48+
// Default to max (auto) speed for MCU with internal HighSpeed PHY
4949
#ifndef BOARD_DEVICE_RHPORT_SPEED
50-
#if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
51-
CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56 || CFG_TUSB_MCU == OPT_MCU_SAMX7X)
52-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
53-
#else
54-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
55-
#endif
50+
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_DEFAULT_SPEED
5651
#endif
5752

5853
// Device mode with rhport and speed defined by board.mk

examples/device/cdc_msc/src/tusb_config.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,9 @@
4545
#endif
4646

4747
// RHPort max operational speed can defined by board.mk
48-
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
48+
// Default to max (auto) speed for MCU with internal HighSpeed PHY
4949
#ifndef BOARD_DEVICE_RHPORT_SPEED
50-
#if TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX, OPT_MCU_MIMXRT10XX, OPT_MCU_NUC505) ||\
51-
TU_CHECK_MCU(OPT_MCU_CXD56, OPT_MCU_SAMX7X, OPT_MCU_BCM2711) ||\
52-
TU_CHECK_MCU(OPT_MCU_FT90X, OPT_MCU_FT93X)
53-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
54-
#else
55-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
56-
#endif
50+
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_DEFAULT_SPEED
5751
#endif
5852

5953
// Device mode with rhport and speed defined by board.mk

examples/device/dfu/src/tusb_config.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,9 @@
2727
#endif
2828

2929
// RHPort max operational speed can defined by board.mk
30-
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
30+
// Default to max (auto) speed for MCU with internal HighSpeed PHY
3131
#ifndef BOARD_DEVICE_RHPORT_SPEED
32-
#if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
33-
CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
34-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
35-
#else
36-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
37-
#endif
32+
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_DEFAULT_SPEED
3833
#endif
3934

4035
// Device mode with rhport and speed defined by board.mk

examples/device/dfu_runtime/src/tusb_config.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,9 @@
2727
#endif
2828

2929
// RHPort max operational speed can defined by board.mk
30-
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
30+
// Default to max (auto) speed for MCU with internal HighSpeed PHY
3131
#ifndef BOARD_DEVICE_RHPORT_SPEED
32-
#if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
33-
CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
34-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
35-
#else
36-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
37-
#endif
32+
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_DEFAULT_SPEED
3833
#endif
3934

4035
// Device mode with rhport and speed defined by board.mk

examples/device/dynamic_configuration/src/tusb_config.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,9 @@
4545
#endif
4646

4747
// RHPort max operational speed can defined by board.mk
48-
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
48+
// Default to max (auto) speed for MCU with internal HighSpeed PHY
4949
#ifndef BOARD_DEVICE_RHPORT_SPEED
50-
#if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
51-
CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
52-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
53-
#else
54-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
55-
#endif
50+
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_DEFAULT_SPEED
5651
#endif
5752

5853
// Device mode with rhport and speed defined by board.mk

examples/device/hid_boot_interface/src/tusb_config.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,9 @@
4545
#endif
4646

4747
// RHPort max operational speed can defined by board.mk
48-
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
48+
// Default to max (auto) speed for MCU with internal HighSpeed PHY
4949
#ifndef BOARD_DEVICE_RHPORT_SPEED
50-
#if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
51-
CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56 || CFG_TUSB_MCU == OPT_MCU_SAMX7X || \
52-
CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X)
53-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
54-
#else
55-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
56-
#endif
50+
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_DEFAULT_SPEED
5751
#endif
5852

5953
// Device mode with rhport and speed defined by board.mk

examples/device/hid_composite/src/tusb_config.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,9 @@
4545
#endif
4646

4747
// RHPort max operational speed can defined by board.mk
48-
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
48+
// Default to max (auto) speed for MCU with internal HighSpeed PHY
4949
#ifndef BOARD_DEVICE_RHPORT_SPEED
50-
#if TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX, OPT_MCU_MIMXRT10XX, OPT_MCU_NUC505) ||\
51-
TU_CHECK_MCU(OPT_MCU_CXD56, OPT_MCU_SAMX7X, OPT_MCU_BCM2711) ||\
52-
TU_CHECK_MCU(OPT_MCU_FT90X, OPT_MCU_FT93X)
53-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
54-
#else
55-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
56-
#endif
50+
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_DEFAULT_SPEED
5751
#endif
5852

5953
// Device mode with rhport and speed defined by board.mk

examples/device/hid_composite_freertos/src/tusb_config.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,9 @@
4545
#endif
4646

4747
// RHPort max operational speed can defined by board.mk
48-
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
48+
// Default to max (auto) speed for MCU with internal HighSpeed PHY
4949
#ifndef BOARD_DEVICE_RHPORT_SPEED
50-
#if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
51-
CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
52-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
53-
#else
54-
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
55-
#endif
50+
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_DEFAULT_SPEED
5651
#endif
5752

5853
// Device mode with rhport and speed defined by board.mk

0 commit comments

Comments
 (0)