From 41babf1cb78a2a8e05f40f5de61c3f52bb794fc4 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 30 Jul 2009 14:06:52 +0000 Subject: Fix incorrect configuration in the ClassDriver AudioOutput demo. Make all audio device Class Driver functions require a reference to the Audio class instance, so that the endpoint size can be checked (and to standardize the APIs). Make LEDs more responsive in the AudioOutput device demos. --- Demos/Device/ClassDriver/AudioInput/AudioInput.c | 6 +++--- Demos/Device/ClassDriver/AudioInput/Descriptors.h | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'Demos/Device/ClassDriver/AudioInput') diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c index 7b7ca2c11..59d2129f4 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c @@ -62,8 +62,7 @@ int main(void) for (;;) { - if (Microphone_Audio_Interface.State.InterfaceEnabled) - ProcessNextSample(); + ProcessNextSample(); Audio_Device_USBTask(&Microphone_Audio_Interface); USB_USBTask(); @@ -95,6 +94,7 @@ void SetupHardware(void) */ void ProcessNextSample(void) { + /* Check if the sample reload timer period has elapsed, and that the USB bus is ready for a new sample */ if ((TIFR0 & (1 << OCF0A)) && Audio_Device_IsReadyForNextSample(&Microphone_Audio_Interface)) { TIFR0 |= (1 << OCF0A); @@ -107,7 +107,7 @@ void ProcessNextSample(void) AudioSample -= (SAMPLE_MAX_RANGE / 2)); #endif - Audio_Device_WriteSample16(AudioSample); + Audio_Device_WriteSample16(&Microphone_Audio_Interface, AudioSample); } } diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.h b/Demos/Device/ClassDriver/AudioInput/Descriptors.h index dca176117..be6415683 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.h @@ -43,12 +43,8 @@ #include /* Macros: */ - #if defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || defined(__DOXYGEN__) - /** Endpoint number of the Audio isochronous streaming data endpoint. */ - #define AUDIO_STREAM_EPNUM 1 - #else - #define AUDIO_STREAM_EPNUM 3 - #endif + /** Endpoint number of the Audio isochronous streaming data endpoint. */ + #define AUDIO_STREAM_EPNUM 1 /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires * at least 192 bytes for correct output, thus the smaller 128 byte maximum endpoint size on some of the smaller -- cgit v1.2.3