summaryrefslogtreecommitdiff
path: root/examples/device/dynamic_configuration
diff options
context:
space:
mode:
Diffstat (limited to 'examples/device/dynamic_configuration')
-rw-r--r--examples/device/dynamic_configuration/CMakeLists.txt2
-rw-r--r--examples/device/dynamic_configuration/CMakePresets.json6
-rw-r--r--examples/device/dynamic_configuration/src/main.c6
-rw-r--r--examples/device/dynamic_configuration/src/usb_descriptors.c17
4 files changed, 14 insertions, 17 deletions
diff --git a/examples/device/dynamic_configuration/CMakeLists.txt b/examples/device/dynamic_configuration/CMakeLists.txt
index 2b20d2234..8a62d6ba2 100644
--- a/examples/device/dynamic_configuration/CMakeLists.txt
+++ b/examples/device/dynamic_configuration/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.17)
+cmake_minimum_required(VERSION 3.20)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
diff --git a/examples/device/dynamic_configuration/CMakePresets.json b/examples/device/dynamic_configuration/CMakePresets.json
new file mode 100644
index 000000000..5cd8971e9
--- /dev/null
+++ b/examples/device/dynamic_configuration/CMakePresets.json
@@ -0,0 +1,6 @@
+{
+ "version": 6,
+ "include": [
+ "../../../hw/bsp/BoardPresets.json"
+ ]
+}
diff --git a/examples/device/dynamic_configuration/src/main.c b/examples/device/dynamic_configuration/src/main.c
index b6409c8e1..32ff58232 100644
--- a/examples/device/dynamic_configuration/src/main.c
+++ b/examples/device/dynamic_configuration/src/main.c
@@ -57,7 +57,11 @@ int main(void)
board_init();
// init device stack on configured roothub port
- tud_init(BOARD_TUD_RHPORT);
+ tusb_rhport_init_t dev_init = {
+ .role = TUSB_ROLE_DEVICE,
+ .speed = TUSB_SPEED_AUTO
+ };
+ tusb_init(BOARD_TUD_RHPORT, &dev_init);
if (board_init_after_tusb) {
board_init_after_tusb();
diff --git a/examples/device/dynamic_configuration/src/usb_descriptors.c b/examples/device/dynamic_configuration/src/usb_descriptors.c
index 7f35b4b22..0a2049288 100644
--- a/examples/device/dynamic_configuration/src/usb_descriptors.c
+++ b/examples/device/dynamic_configuration/src/usb_descriptors.c
@@ -132,21 +132,8 @@ enum
#define EPNUM_1_MSC_OUT 0x02
#define EPNUM_1_MSC_IN 0x82
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG
- // SAMG doesn't support a same endpoint number with different direction IN and OUT
- // e.g EP1 OUT & EP1 IN cannot exist together
- #define EPNUM_0_CDC_NOTIF 0x81
- #define EPNUM_0_CDC_OUT 0x02
- #define EPNUM_0_CDC_IN 0x83
-
- #define EPNUM_0_MIDI_OUT 0x04
- #define EPNUM_0_MIDI_IN 0x85
-
- #define EPNUM_1_MSC_OUT 0x01
- #define EPNUM_1_MSC_IN 0x82
-
-#elif CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X
- // FT9XX doesn't support a same endpoint number with different direction IN and OUT
+#elif defined(TUD_ENDPOINT_ONE_DIRECTION_ONLY)
+ // MCUs that don't support a same endpoint number with different direction IN and OUT defined in tusb_mcu.h
// e.g EP1 OUT & EP1 IN cannot exist together
#define EPNUM_0_CDC_NOTIF 0x81
#define EPNUM_0_CDC_OUT 0x02