X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/6e0a26083ad76d2cea5aa934b530fdd8d6f4e7c1..21a012a018221fd1e55b8b054d09d7900ed9fd79:/LUFA/Drivers/USB/Class/Host/Audio.c?ds=sidebyside diff --git a/LUFA/Drivers/USB/Class/Host/Audio.c b/LUFA/Drivers/USB/Class/Host/Audio.c index 5760b6af8..1d590e841 100644 --- a/LUFA/Drivers/USB/Class/Host/Audio.c +++ b/LUFA/Drivers/USB/Class/Host/Audio.c @@ -51,18 +51,19 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration) return AUDIO_ENUMERROR_InvalidConfigDescriptor; - while (!(DataINEndpoint) || !(DataOUTEndpoint)) + while ((AudioInterfaceInfo->Config.DataINPipeNumber && !(DataINEndpoint)) || + (AudioInterfaceInfo->Config.DataOUTPipeNumber && !(DataOUTEndpoint))) { if (!(AudioControlInterface) || USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, - DComp_NextAudioInterfaceDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found) + DCOMP_Audio_Host_NextAudioInterfaceDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found) { if (!(AudioControlInterface) || USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, - DComp_NextAudioStreamInterface) != DESCRIPTOR_SEARCH_COMP_Found) + DCOMP_Audio_Host_NextAudioStreamInterface) != DESCRIPTOR_SEARCH_COMP_Found) { if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, - DComp_NextAudioControlInterface) != DESCRIPTOR_SEARCH_COMP_Found) + DCOMP_Audio_Host_NextAudioControlInterface) != DESCRIPTOR_SEARCH_COMP_Found) { return AUDIO_ENUMERROR_NoCompatibleInterfaceFound; } @@ -70,13 +71,16 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa AudioControlInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t); if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, - DComp_NextAudioStreamInterface) != DESCRIPTOR_SEARCH_COMP_Found) + DCOMP_Audio_Host_NextAudioStreamInterface) != DESCRIPTOR_SEARCH_COMP_Found) { return AUDIO_ENUMERROR_NoCompatibleInterfaceFound; } } AudioStreamingInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t); + + DataINEndpoint = NULL; + DataOUTEndpoint = NULL; continue; } @@ -137,7 +141,7 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa return AUDIO_ENUMERROR_NoError; } -static uint8_t DComp_NextAudioControlInterface(void* CurrentDescriptor) +static uint8_t DCOMP_Audio_Host_NextAudioControlInterface(void* CurrentDescriptor) { USB_Descriptor_Header_t* Header = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Header_t); @@ -156,7 +160,7 @@ static uint8_t DComp_NextAudioControlInterface(void* CurrentDescriptor) return DESCRIPTOR_SEARCH_NotFound; } -static uint8_t DComp_NextAudioStreamInterface(void* CurrentDescriptor) +static uint8_t DCOMP_Audio_Host_NextAudioStreamInterface(void* CurrentDescriptor) { USB_Descriptor_Header_t* Header = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Header_t); @@ -175,7 +179,7 @@ static uint8_t DComp_NextAudioStreamInterface(void* CurrentDescriptor) return DESCRIPTOR_SEARCH_NotFound; } -static uint8_t DComp_NextAudioInterfaceDataEndpoint(void* CurrentDescriptor) +static uint8_t DCOMP_Audio_Host_NextAudioInterfaceDataEndpoint(void* CurrentDescriptor) { USB_Descriptor_Header_t* Header = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Header_t); @@ -195,7 +199,7 @@ static uint8_t DComp_NextAudioInterfaceDataEndpoint(void* CurrentDescriptor) } uint8_t Audio_Host_StartStopStreaming(USB_ClassInfo_Audio_Host_t* const AudioInterfaceInfo, - bool EnableStreaming) + const bool EnableStreaming) { if (!(AudioInterfaceInfo->State.IsActive)) return HOST_SENDCONTROL_DeviceDisconnected; @@ -208,7 +212,7 @@ uint8_t Audio_GetSetEndpointProperty(USB_ClassInfo_Audio_Host_t* const AudioInte const uint8_t DataPipeIndex, const uint8_t EndpointProperty, const uint8_t EndpointControl, - uint16_t const DataLength, + const uint16_t DataLength, void* const Data) { if (!(AudioInterfaceInfo->State.IsActive))