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/LowLevel/AudioOutput/AudioOutput.c | 10 +++++----- Demos/Device/LowLevel/AudioOutput/AudioOutput.h | 1 + Demos/Device/LowLevel/AudioOutput/Descriptors.h | 8 ++------ 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'Demos/Device/LowLevel/AudioOutput') diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c index c814c8ce5..352d07482 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c @@ -30,7 +30,7 @@ /** \file * - * Main source file for the Audio Output demo. This file contains the main tasks of the demo and + * Main source file for the AudioOutput demo. This file contains the main tasks of the demo and * is responsible for the initial application hardware configuration. */ @@ -231,16 +231,16 @@ void USB_Audio_Task(void) /* Make mixed sample value positive (absolute) */ MixedSample_8Bit = abs(MixedSample_8Bit); - if (MixedSample_8Bit > ((128 / 8) * 1)) + if (MixedSample_8Bit > 2) LEDMask |= LEDS_LED1; - if (MixedSample_8Bit > ((128 / 8) * 2)) + if (MixedSample_8Bit > 4) LEDMask |= LEDS_LED2; - if (MixedSample_8Bit > ((128 / 8) * 3)) + if (MixedSample_8Bit > 8) LEDMask |= LEDS_LED3; - if (MixedSample_8Bit > ((128 / 8) * 4)) + if (MixedSample_8Bit > 16) LEDMask |= LEDS_LED4; LEDs_SetAllLEDs(LEDMask); diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h index 8d7f16c5f..6c8d733f3 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h @@ -40,6 +40,7 @@ #include #include #include + #include #include "Descriptors.h" diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.h b/Demos/Device/LowLevel/AudioOutput/Descriptors.h index a16a76f19..0623c7775 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.h @@ -137,12 +137,8 @@ */ #define EP_ACCEPTS_SMALL_PACKETS (0 << 7) - #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