diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-06-07 02:05:19 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-06-07 02:05:19 +0000 |
| commit | 086160402a4d6300c0684f2e416124ab84f54b4a (patch) | |
| tree | 7a4ba143776c89e2f378d0e99d6fd4c296444ac6 /Demos/Device/LowLevel/AudioOutput | |
| parent | cdba5c72ac5e752594a0a0429b1e2a14d930a098 (diff) | |
Fix errors in the Audio device demos and class driver regarding multiple sample frequency support.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1787 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Device/LowLevel/AudioOutput')
| -rw-r--r-- | Demos/Device/LowLevel/AudioOutput/AudioOutput.c | 12 | ||||
| -rw-r--r-- | Demos/Device/LowLevel/AudioOutput/Descriptors.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c index c5d93630..fcc3d5ab 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c @@ -186,12 +186,12 @@ void EVENT_USB_Device_ControlRequest(void) case AUDIO_REQ_SetCurrent: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT)) { - /* Extract out the relevant request information to get the target Endpoint index and control being set */ - uint8_t EndpointIndex = (uint8_t)USB_ControlRequest.wIndex; + /* Extract out the relevant request information to get the target Endpoint address and control being set */ + uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex; uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); /* Only handle SET CURRENT requests to the audio endpoint's sample frequency property */ - if ((EndpointIndex == AUDIO_STREAM_EPNUM) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) + if ((EndpointAddress == (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; @@ -211,12 +211,12 @@ void EVENT_USB_Device_ControlRequest(void) case AUDIO_REQ_GetCurrent: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT)) { - /* Extract out the relevant request information to get the target Endpoint index and control being retrieved */ - uint8_t EndpointIndex = (uint8_t)USB_ControlRequest.wIndex; + /* Extract out the relevant request information to get the target Endpoint address and control being retrieved */ + uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex; uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); /* Only handle GET CURRENT requests to the audio endpoint's sample frequency property */ - if ((EndpointIndex == AUDIO_STREAM_EPNUM) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) + if ((EndpointAddress == (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.c b/Demos/Device/LowLevel/AudioOutput/Descriptors.c index a86eee75..0a6ec6d6 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.c @@ -235,7 +235,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint}, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, - .Attributes = AUDIO_EP_ACCEPTS_SMALL_PACKETS, + .Attributes = (AUDIO_EP_ACCEPTS_SMALL_PACKETS | AUDIO_EP_SAMPLE_FREQ_CONTROL), .LockDelayUnits = 0x00, .LockDelay = 0x0000 |
