diff options
| author | hathach <[email protected]> | 2019-07-05 16:46:11 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-07-05 16:46:11 +0700 |
| commit | 216ccc6e93fe294e80bb17bfb873bfb00f5ac038 (patch) | |
| tree | 0a618b17523842b125b867d73e45b3ea7fb11c1f /src/class/midi | |
| parent | f16ebd512bbaed3971a6e5a28168413279abf4c4 (diff) | |
midi only use audio 1.0 without IAD
Diffstat (limited to 'src/class/midi')
| -rw-r--r-- | src/class/midi/midi_device.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/class/midi/midi_device.c b/src/class/midi/midi_device.c index 76776d71c..267167720 100644 --- a/src/class/midi/midi_device.c +++ b/src/class/midi/midi_device.c @@ -250,15 +250,13 @@ bool midid_open(uint8_t rhport, tusb_desc_interface_t const * p_interface_desc, (*p_length) = sizeof(tusb_desc_interface_t);
// Skip over the class specific descriptor.
- (*p_length) += p_desc[DESC_OFFSET_LEN];
+ (*p_length) += tu_desc_len(p_desc);
p_desc = tu_desc_next(p_desc);
return true;
}
- if ( AUDIO_SUBCLASS_MIDI_STREAMING != p_interface_desc->bInterfaceSubClass ||
- p_interface_desc->bInterfaceProtocol != AUDIO_PROTOCOL_V1 ) {
- return false;
- }
+ TU_VERIFY(AUDIO_SUBCLASS_MIDI_STREAMING == p_interface_desc->bInterfaceSubClass &&
+ AUDIO_PROTOCOL_V1 == p_interface_desc->bInterfaceProtocol );
// Find available interface
midid_interface_t * p_midi = NULL;
|
