mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-18 07:21:00 +00:00
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.
This commit is contained in:
parent
f4a44ee063
commit
e67fc808aa
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user