summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2026-05-17 14:11:53 +0200
committerHiFiPhile <[email protected]>2026-05-17 14:11:53 +0200
commit3f209e2a00538726992ba908fe905213c78a9f6e (patch)
tree3bcda2e29f6415d4b6571e854de75f0478788bc4 /src
parent116395a1b24f2cb1787b4110a8c3749a0435f1ee (diff)
midi2: move config to class header
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/class/midi/midi2_device.h43
-rw-r--r--src/tusb_option.h38
2 files changed, 43 insertions, 38 deletions
diff --git a/src/class/midi/midi2_device.h b/src/class/midi/midi2_device.h
index 8c64729c3..b7caf97a3 100644
--- a/src/class/midi/midi2_device.h
+++ b/src/class/midi/midi2_device.h
@@ -45,8 +45,51 @@ extern "C" {
#endif
//--------------------------------------------------------------------+
+// Class Driver Configuration
+//--------------------------------------------------------------------+
+
+#ifndef CFG_TUD_MIDI2_TX_BUFSIZE
+ #define CFG_TUD_MIDI2_TX_BUFSIZE TUD_EPSIZE_BULK_MAX
+#endif
+
+#ifndef CFG_TUD_MIDI2_RX_BUFSIZE
+ #define CFG_TUD_MIDI2_RX_BUFSIZE TUD_EPSIZE_BULK_MAX
+#endif
+
+#ifndef CFG_TUD_MIDI2_TX_EPSIZE
+ #define CFG_TUD_MIDI2_TX_EPSIZE TUD_EPSIZE_BULK_MAX
+#endif
+
+#ifndef CFG_TUD_MIDI2_RX_EPSIZE
+ #define CFG_TUD_MIDI2_RX_EPSIZE TUD_EPSIZE_BULK_MAX
+#endif
+
+#ifndef CFG_TUD_MIDI2_NUM_GROUPS
+ #define CFG_TUD_MIDI2_NUM_GROUPS 1
+#endif
+
+#ifndef CFG_TUD_MIDI2_NUM_FUNCTION_BLOCKS
+ #define CFG_TUD_MIDI2_NUM_FUNCTION_BLOCKS 1
+#endif
+
+#ifndef CFG_TUD_MIDI2_EP_NAME
+ #define CFG_TUD_MIDI2_EP_NAME "TinyUSB MIDI 2.0"
+#endif
+
+#ifndef CFG_TUD_MIDI2_PRODUCT_ID
+ #define CFG_TUD_MIDI2_PRODUCT_ID "TinyUSB-MIDI2"
+#endif
+
+// String descriptor index for the Group Terminal Block (iBlockItem, Table 5-6).
+// 0 = no string descriptor (default, spec-allowed).
+#ifndef CFG_TUD_MIDI2_BLOCK_STRIDX
+ #define CFG_TUD_MIDI2_BLOCK_STRIDX 0
+#endif
+
+//--------------------------------------------------------------------+
// MIDI Protocol Values (returned by tud_midi2_n_protocol)
//--------------------------------------------------------------------+
+
// Per USB-MIDI 2.0 spec, UMP Stream Configuration messages.
enum {
MIDI_PROTOCOL_MIDI1 = 0x01,
diff --git a/src/tusb_option.h b/src/tusb_option.h
index 2614110fc..0114b86ee 100644
--- a/src/tusb_option.h
+++ b/src/tusb_option.h
@@ -650,44 +650,6 @@
#define CFG_TUD_MIDI2 0
#endif
-#ifndef CFG_TUD_MIDI2_TX_BUFSIZE
- #define CFG_TUD_MIDI2_TX_BUFSIZE 256
-#endif
-
-#ifndef CFG_TUD_MIDI2_RX_BUFSIZE
- #define CFG_TUD_MIDI2_RX_BUFSIZE 256
-#endif
-
-#ifndef CFG_TUD_MIDI2_TX_EPSIZE
- #define CFG_TUD_MIDI2_TX_EPSIZE 64
-#endif
-
-#ifndef CFG_TUD_MIDI2_RX_EPSIZE
- #define CFG_TUD_MIDI2_RX_EPSIZE 64
-#endif
-
-#ifndef CFG_TUD_MIDI2_NUM_GROUPS
- #define CFG_TUD_MIDI2_NUM_GROUPS 1
-#endif
-
-#ifndef CFG_TUD_MIDI2_NUM_FUNCTION_BLOCKS
- #define CFG_TUD_MIDI2_NUM_FUNCTION_BLOCKS 1
-#endif
-
-#ifndef CFG_TUD_MIDI2_EP_NAME
- #define CFG_TUD_MIDI2_EP_NAME "TinyUSB MIDI 2.0"
-#endif
-
-#ifndef CFG_TUD_MIDI2_PRODUCT_ID
- #define CFG_TUD_MIDI2_PRODUCT_ID "TinyUSB-MIDI2"
-#endif
-
-// String descriptor index for the Group Terminal Block (iBlockItem, Table 5-6).
-// 0 = no string descriptor (default, spec-allowed).
-#ifndef CFG_TUD_MIDI2_BLOCK_STRIDX
- #define CFG_TUD_MIDI2_BLOCK_STRIDX 0
-#endif
-
#ifndef CFG_TUD_VENDOR
#define CFG_TUD_VENDOR 0
#endif