aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/ClassDriver/AudioInput/AudioInput.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-07-30 14:06:52 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-07-30 14:06:52 +0000
commit41babf1cb78a2a8e05f40f5de61c3f52bb794fc4 (patch)
tree0ad2a05c55c83817a9cfefa6c2b68cd6ae0324d5 /Demos/Device/ClassDriver/AudioInput/AudioInput.c
parent41b54a2acd2d5515cc7f3f1ed1c3d3b17d1988a1 (diff)
downloadlufa-41babf1cb78a2a8e05f40f5de61c3f52bb794fc4.tar.gz
lufa-41babf1cb78a2a8e05f40f5de61c3f52bb794fc4.tar.bz2
lufa-41babf1cb78a2a8e05f40f5de61c3f52bb794fc4.zip
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.
Diffstat (limited to 'Demos/Device/ClassDriver/AudioInput/AudioInput.c')
-rw-r--r--Demos/Device/ClassDriver/AudioInput/AudioInput.c6
1 files changed, 3 insertions, 3 deletions
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);
}
}