Fix mic audio descriptor, fix too strict check on IAD desc. in usbd.c
This commit is contained in:
@@ -57,6 +57,12 @@ typedef enum
|
||||
AUDIO_SUBCLASS_MIDI_STREAMING , ///< MIDI Streaming
|
||||
} audio_subclass_type_t;
|
||||
|
||||
/// Audio Function Subclass Codes
|
||||
typedef enum
|
||||
{
|
||||
AUDIO_FUNCTION_SUBCLASS_UNDEFINED = 0x00,
|
||||
} audio_function_subclass_type_t;
|
||||
|
||||
/// Audio Protocol Codes
|
||||
typedef enum
|
||||
{
|
||||
|
||||
@@ -632,7 +632,7 @@ void audiod_reset(uint8_t rhport)
|
||||
}
|
||||
}
|
||||
|
||||
bool audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t *p_length)
|
||||
uint16_t audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
|
||||
{
|
||||
TU_VERIFY ( TUSB_CLASS_AUDIO == itf_desc->bInterfaceClass &&
|
||||
AUDIO_SUBCLASS_CONTROL == itf_desc->bInterfaceSubClass);
|
||||
@@ -666,9 +666,11 @@ bool audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_
|
||||
// This is all we need so far - the EPs are setup by a later set_interface request (as per UAC2 specification)
|
||||
|
||||
// Notify caller we read complete descriptor
|
||||
(*p_length) += tud_audio_desc_lengths[i];
|
||||
// (*p_length) += tud_audio_desc_lengths[i];
|
||||
// TODO: Find a way to find end of current audio function and avoid necessity of tud_audio_desc_lengths - since now max_length is available we could do this surely somehow
|
||||
uint16_t drv_len = tud_audio_desc_lengths[i] - TUD_AUDIO_DESC_IAD_LEN; // - TUD_AUDIO_DESC_IAD_LEN since tinyUSB already handles the IAD descriptor
|
||||
|
||||
return true;
|
||||
return drv_len;
|
||||
}
|
||||
|
||||
static bool audiod_get_interface(uint8_t rhport, tusb_control_request_t const * p_request)
|
||||
|
||||
@@ -289,7 +289,7 @@ inline uint16_t tud_audio_int_ctr_write(uint8_t const* buffer, uint16_t bufsize)
|
||||
//--------------------------------------------------------------------+
|
||||
void audiod_init (void);
|
||||
void audiod_reset (uint8_t rhport);
|
||||
bool audiod_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t *p_length);
|
||||
uint16_t audiod_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
|
||||
bool audiod_control_request (uint8_t rhport, tusb_control_request_t const * request);
|
||||
bool audiod_control_complete (uint8_t rhport, tusb_control_request_t const * request);
|
||||
bool audiod_xfer_cb (uint8_t rhport, uint8_t edpt_addr, xfer_result_t result, uint32_t xferred_bytes);
|
||||
|
||||
Reference in New Issue
Block a user