Update AudioInput and AudioOutput Class Driver device mode demos to use a switch statement when selecting the audio request type for clarity.

This commit is contained in:
Dean Camera 2011-06-29 05:36:26 +00:00
parent 8c3d421a01
commit 75da0d1877
3 changed files with 47 additions and 51 deletions

View File

@ -201,9 +201,9 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t*
/* Check the requested control to see if a supported control is being manipulated */
if (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)
{
/* Check the requested property to see if a supported property is being manipulated */
if (EndpointProperty == AUDIO_REQ_SetCurrent)
switch (EndpointProperty)
{
case AUDIO_REQ_SetCurrent:
/* Check if we are just testing for a valid property, or actually adjusting it */
if (DataLength != NULL)
{
@ -215,9 +215,7 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t*
}
return true;
}
else if (EndpointProperty == AUDIO_REQ_GetCurrent)
{
case AUDIO_REQ_GetCurrent:
/* Check if we are just testing for a valid property, or actually reading it */
if (DataLength != NULL)
{

View File

@ -238,9 +238,9 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t*
/* Check the requested control to see if a supported control is being manipulated */
if (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)
{
/* Check the requested property to see if a supported property is being manipulated */
if (EndpointProperty == AUDIO_REQ_SetCurrent)
switch (EndpointProperty)
{
case AUDIO_REQ_SetCurrent:
/* Check if we are just testing for a valid property, or actually adjusting it */
if (DataLength != NULL)
{
@ -252,9 +252,7 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t*
}
return true;
}
else if (EndpointProperty == AUDIO_REQ_GetCurrent)
{
case AUDIO_REQ_GetCurrent:
/* Check if we are just testing for a valid property, or actually reading it */
if (DataLength != NULL)
{

File diff suppressed because one or more lines are too long