diff options
| author | rppicomidi <[email protected]> | 2022-08-25 15:09:27 -0700 |
|---|---|---|
| committer | atoktoto <[email protected]> | 2022-11-13 14:29:16 +0100 |
| commit | 3325e2613d4bc68ac2443445e62520baa4bbe6cb (patch) | |
| tree | ec64633e2dc38dc3b9a793a83b27c9d3aee61a4d /src/device | |
| parent | 70eefcb849542f386a1349da7a4944d2d02dcd40 (diff) | |
Make USB MIDI device code allow a device with no Audio Control interface
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/usbd.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index c199e647e..1cede1289 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -920,7 +920,15 @@ static bool process_set_config(uint8_t rhport, uint8_t cfg_num) #endif #if CFG_TUD_MIDI - if ( driver->open == midid_open ) assoc_itf_count = 2; + if ( driver->open == midid_open ) + { + // If there is a class-compliant Audio Control Class, then 2 interfaces + // Otherwise, only one + if (TUSB_CLASS_AUDIO == desc_itf->bInterfaceClass && + AUDIO_SUBCLASS_CONTROL == desc_itf->bInterfaceSubClass && + AUDIO_FUNC_PROTOCOL_CODE_UNDEF == desc_itf->bInterfaceProtocol) + assoc_itf_count = 2; + } #endif #if CFG_TUD_BTH && CFG_TUD_BTH_ISO_ALT_COUNT |
