aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/ClassDriver/AudioOutput
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/ClassDriver/AudioOutput')
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/AudioOutput.c18
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/makefile1
2 files changed, 9 insertions, 10 deletions
diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
index d7de7d5b0..a73f1c96e 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 ec60801be..7ece3734b 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