summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorGordon McNab <[email protected]>2021-12-15 12:23:58 +0000
committerGordon McNab <[email protected]>2021-12-15 12:23:58 +0000
commit8d373b08879ac382c59dcbfb2d351d4af35e3d00 (patch)
treeed5f9382b7e13ed2d27b449f513ec8e9da03ce1d /examples/device
parent21fa7ea468cf34e6d775c92de580796d2c7eec4f (diff)
Update midi_test endpoints and FT9xx code
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/midi_test/src/usb_descriptors.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/device/midi_test/src/usb_descriptors.c b/examples/device/midi_test/src/usb_descriptors.c
index bd5a0eeab..8444237c6 100644
--- a/examples/device/midi_test/src/usb_descriptors.c
+++ b/examples/device/midi_test/src/usb_descriptors.c
@@ -83,9 +83,15 @@ 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 0x02
+ #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
#else
- #define EPNUM_MIDI 0x01
+ #define EPNUM_MIDI_OUT 0x01
+ #define EPNUM_MIDI_IN 0x01
#endif
uint8_t const desc_fs_configuration[] =
@@ -94,7 +100,7 @@ uint8_t const desc_fs_configuration[] =
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
// Interface number, string index, EP Out & EP In address, EP size
- TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI, 0, EPNUM_MIDI, 0x80 | EPNUM_MIDI, 64)
+ TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI, 0, EPNUM_MIDI_OUT, (0x80 | EPNUM_MIDI_IN), 64)
};
#if TUD_OPT_HIGH_SPEED
@@ -104,7 +110,7 @@ uint8_t const desc_hs_configuration[] =
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
// Interface number, string index, EP Out & EP In address, EP size
- TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI, 0, EPNUM_MIDI, 0x80 | EPNUM_MIDI, 512)
+ TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI, 0, EPNUM_MIDI_OUT, (0x80 | EPNUM_MIDI_IN), 512)
};
#endif