From e67fc808aada31a549399a0b0337b43ec45535d1 Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Fri, 11 Sep 2020 13:13:25 +0200 Subject: [PATCH] audio_device: Store rhport in interface data Some API uses interface number as argument, some wants to have rhport. To accommodate need of rhport for functions that don't have it rhport can be extracted from interface data. --- src/class/audio/audio_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/class/audio/audio_device.c b/src/class/audio/audio_device.c index ebb8434cd..fd24d455c 100644 --- a/src/class/audio/audio_device.c +++ b/src/class/audio/audio_device.c @@ -48,6 +48,7 @@ //--------------------------------------------------------------------+ typedef struct { + uint8_t rhport; uint8_t const * p_desc; // Pointer pointing to Standard AC Interface Descriptor(4.7.1) - Audio Control descriptor defining audio function #if CFG_TUD_AUDIO_EPSIZE_IN @@ -673,6 +674,7 @@ uint16_t audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uin if (!_audiod_itf[i].p_desc) { _audiod_itf[i].p_desc = (uint8_t const *)itf_desc; // Save pointer to AC descriptor which is by specification always the first one + _audiod_itf[i].rhport = rhport; break; } }