summaryrefslogtreecommitdiff
path: root/examples/device/midi_test
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-08-17 18:07:36 +0700
committerhathach <[email protected]>2024-08-17 18:07:36 +0700
commita6bee747b6f550e4fdb144c7db4aad70fee5ac69 (patch)
tree0b3cbf2b622aaf0594454f15d2944c01be6c355b /examples/device/midi_test
parent993473312b390b722d8693c23310b306997f8c2b (diff)
define and use TUD_ENDPOINT_EXCLUSIVE_NUMBER
Diffstat (limited to 'examples/device/midi_test')
-rw-r--r--examples/device/midi_test/src/usb_descriptors.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/examples/device/midi_test/src/usb_descriptors.c b/examples/device/midi_test/src/usb_descriptors.c
index 41e6e1818..3511f7eba 100644
--- a/examples/device/midi_test/src/usb_descriptors.c
+++ b/examples/device/midi_test/src/usb_descriptors.c
@@ -84,20 +84,24 @@ enum
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
- #define EPNUM_MIDI_OUT 0x02
- #define EPNUM_MIDI_IN 0x02
-#elif CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X
- // On Bridgetek FT9xx endpoint numbers must be unique...
- #define EPNUM_MIDI_OUT 0x02
- #define EPNUM_MIDI_IN 0x03
-#elif CFG_TUSB_MCU == OPT_MCU_MAX32690 || CFG_TUSB_MCU == OPT_MCU_MAX32650 || \
- CFG_TUSB_MCU == OPT_MCU_MAX32666 || CFG_TUSB_MCU == OPT_MCU_MAX78002
- // On MAX32 endpoint numbers must be unique...
- #define EPNUM_MIDI_OUT 0x02
- #define EPNUM_MIDI_IN 0x03
+ #define EPNUM_MIDI_OUT 0x02
+ #define EPNUM_MIDI_IN 0x82
+
+#elif CFG_TUSB_MCU == OPT_MCU_CXD56
+ // CXD56 USB driver has fixed endpoint type (bulk/interrupt/iso) and direction (IN/OUT) by its number
+ // 0 control (IN/OUT), 1 Bulk (IN), 2 Bulk (OUT), 3 In (IN), 4 Bulk (IN), 5 Bulk (OUT), 6 In (IN)
+ #define EPNUM_MIDI_OUT 0x02
+ #define EPNUM_MIDI_IN 0x81
+
+#elif defined(TUD_ENDPOINT_EXCLUSIVE_NUMBER)
+ // 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_MIDI_OUT 0x01
+ #define EPNUM_MIDI_IN 0x82
+
#else
- #define EPNUM_MIDI_OUT 0x01
- #define EPNUM_MIDI_IN 0x01
+ #define EPNUM_MIDI_OUT 0x01
+ #define EPNUM_MIDI_IN 0x81
#endif
uint8_t const desc_fs_configuration[] =