Skip to content

Commit 11d6f54

Browse files
committed
midi only use audio 1.0 without IAD
1 parent 855523d commit 11d6f54

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

cores/arduino/Adafruit_TinyUSB_Core/tinyusb/src/class/midi/midi_device.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,13 @@ bool midid_open(uint8_t rhport, tusb_desc_interface_t const * p_interface_desc,
250250
(*p_length) = sizeof(tusb_desc_interface_t);
251251

252252
// Skip over the class specific descriptor.
253-
(*p_length) += p_desc[DESC_OFFSET_LEN];
253+
(*p_length) += tu_desc_len(p_desc);
254254
p_desc = tu_desc_next(p_desc);
255255
return true;
256256
}
257257

258-
if ( AUDIO_SUBCLASS_MIDI_STREAMING != p_interface_desc->bInterfaceSubClass ||
259-
p_interface_desc->bInterfaceProtocol != AUDIO_PROTOCOL_V1 ) {
260-
return false;
261-
}
258+
TU_VERIFY(AUDIO_SUBCLASS_MIDI_STREAMING == p_interface_desc->bInterfaceSubClass &&
259+
AUDIO_PROTOCOL_V1 == p_interface_desc->bInterfaceProtocol );
262260

263261
// Find available interface
264262
midid_interface_t * p_midi = NULL;

cores/arduino/Adafruit_TinyUSB_Core/tinyusb/src/device/usbd.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,12 @@ TU_ATTR_WEAK void tud_resume_cb(void);
174174
//------------- MIDI -------------//
175175

176176
// Length of template descriptor (96 bytes)
177-
#define TUD_MIDI_DESC_LEN (8 + 9 + 9 + 9 + 7 + 6 + 6 + 9 + 9 + 7 + 5 + 7 + 5)
177+
#define TUD_MIDI_DESC_LEN (9 + 9 + 9 + 7 + 6 + 6 + 9 + 9 + 7 + 5 + 7 + 5)
178178

179179
// MIDI simple descriptor
180180
// - 1 Embedded Jack In connected to 1 External Jack Out
181181
// - 1 Embedded Jack out connected to 1 External Jack In
182182
#define TUD_MIDI_DESCRIPTOR(_itfnum, _stridx, _epin, _epout, _epsize) \
183-
/* Interface Associate */\
184-
8, TUSB_DESC_INTERFACE_ASSOCIATION, _itfnum, 2, TUSB_CLASS_AUDIO, 0x00, AUDIO_PROTOCOL_V1, 0,\
185183
/* Audio Control (AC) Interface */\
186184
9, TUSB_DESC_INTERFACE, _itfnum, 0, 0, TUSB_CLASS_AUDIO, AUDIO_SUBCLASS_CONTROL, AUDIO_PROTOCOL_V1, _stridx,\
187185
/* AC Header */\

0 commit comments

Comments
 (0)