aboutsummaryrefslogtreecommitdiff
path: root/Demos
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2009-10-03 07:59:32 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2009-10-03 07:59:32 +0000
commita267bba5e3b45cf6fd3aa9730bec2fb452be6bb0 (patch)
tree7f69f5ea95c68005221caab40a9bb1e11ae5b80a /Demos
parent68012b1c335431b1faeff5c13e2e8e5afb0f5637 (diff)
Changed Audio Class driver sample read/write functions to be inline, to reduce the number of cycles needed to transfer samples to and from the device (allowing more time for processing and output).
Fixed ClassDriver AudioOutput demo not selecting an audio output mode. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@857 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos')
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/AudioOutput.c18
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/makefile1
-rw-r--r--Demos/Device/LowLevel/AudioOutput/AudioOutput.c18
3 files changed, 17 insertions, 20 deletions
diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
index d7de7d5b..a73f1c96 100644
--- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
+++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
@@ -123,17 +123,15 @@ void ProcessNextSample(void)
uint8_t LEDMask = LEDS_NO_LEDS;
- if (MixedSample_8Bit_Abs > 2)
- LEDMask |= LEDS_LED1;
-
- if (MixedSample_8Bit_Abs > 4)
- LEDMask |= LEDS_LED2;
-
- if (MixedSample_8Bit_Abs > 8)
- LEDMask |= LEDS_LED3;
-
+ /* Turn on LEDs as the sample amplitude increases */
if (MixedSample_8Bit_Abs > 16)
- LEDMask |= LEDS_LED4;
+ LEDMask = (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4);
+ else if (MixedSample_8Bit_Abs > 8)
+ LEDMask = (LEDS_LED1 | LEDS_LED2 | LEDS_LED3);
+ else if (MixedSample_8Bit_Abs > 4)
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ else if (MixedSample_8Bit_Abs > 2)
+ LEDMask = (LEDS_LED1);
LEDs_SetAllLEDs(LEDMask);
}
diff --git a/Demos/Device/ClassDriver/AudioOutput/makefile b/Demos/Device/ClassDriver/AudioOutput/makefile
index ec60801b..7ece3734 100644
--- a/Demos/Device/ClassDriver/AudioOutput/makefile
+++ b/Demos/Device/ClassDriver/AudioOutput/makefile
@@ -184,6 +184,7 @@ CSTANDARD = -std=gnu99
# Place -D or -U options here for C sources
CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
+CDEFS += -DAUDIO_OUT_STEREO
# Place -D or -U options here for ASM sources
diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c
index 1128e8f4..dd880b43 100644
--- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c
+++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c
@@ -230,17 +230,15 @@ void USB_Audio_Task(void)
uint8_t LEDMask = LEDS_NO_LEDS;
- if (MixedSample_8Bit_Abs > 2)
- LEDMask |= LEDS_LED1;
-
- if (MixedSample_8Bit_Abs > 4)
- LEDMask |= LEDS_LED2;
-
- if (MixedSample_8Bit_Abs > 8)
- LEDMask |= LEDS_LED3;
-
+ /* Turn on LEDs as the sample amplitude increases */
if (MixedSample_8Bit_Abs > 16)
- LEDMask |= LEDS_LED4;
+ LEDMask = (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4);
+ else if (MixedSample_8Bit_Abs > 8)
+ LEDMask = (LEDS_LED1 | LEDS_LED2 | LEDS_LED3);
+ else if (MixedSample_8Bit_Abs > 4)
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ else if (MixedSample_8Bit_Abs > 2)
+ LEDMask = (LEDS_LED1);
LEDs_SetAllLEDs(LEDMask);
}