diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-06-13 00:19:40 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-06-13 00:19:40 +0000 |
commit | deaab900899b90cc3fea4adb48cbc82e2dfe7de8 (patch) | |
tree | 3fd88c1a005796f917f9bf945cab22b470fc150c /LUFA | |
parent | 6e0a26083ad76d2cea5aa934b530fdd8d6f4e7c1 (diff) | |
download | lufa-deaab900899b90cc3fea4adb48cbc82e2dfe7de8.tar.gz lufa-deaab900899b90cc3fea4adb48cbc82e2dfe7de8.tar.bz2 lufa-deaab900899b90cc3fea4adb48cbc82e2dfe7de8.zip |
Ensure that only the requested Audio class pipes are mapped to endpoints within the device for a specific Audio Host Class driver instance.
Fix const-correctness of the Audio Host Class driver.
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/Audio.c | 10 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/Audio.h | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/Audio.c b/LUFA/Drivers/USB/Class/Host/Audio.c index 5760b6af8..238091321 100644 --- a/LUFA/Drivers/USB/Class/Host/Audio.c +++ b/LUFA/Drivers/USB/Class/Host/Audio.c @@ -51,7 +51,8 @@ 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,
@@ -77,6 +78,9 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa }
AudioStreamingInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t);
+
+ DataINEndpoint = NULL;
+ DataOUTEndpoint = NULL;
continue;
}
@@ -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))
diff --git a/LUFA/Drivers/USB/Class/Host/Audio.h b/LUFA/Drivers/USB/Class/Host/Audio.h index 26d537614..91ea0e265 100644 --- a/LUFA/Drivers/USB/Class/Host/Audio.h +++ b/LUFA/Drivers/USB/Class/Host/Audio.h @@ -145,7 +145,7 @@ * \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
*/
uint8_t Audio_Host_StartStopStreaming(USB_ClassInfo_Audio_Host_t* const AudioInterfaceInfo,
- bool EnableStreaming);
+ const bool EnableStreaming);
/** Gets or sets the specified property of a streaming audio class endpoint that is bound to a pipe in the given
* class instance.
@@ -165,7 +165,7 @@ const uint8_t DataPipeIndex,
const uint8_t EndpointProperty,
const uint8_t EndpointControl,
- uint16_t const DataLength,
+ const uint16_t DataLength,
void* const Data);
/* Inline Functions: */
|