aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Host/Audio.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-06-12 13:59:03 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-06-12 13:59:03 +0000
commit6e0a26083ad76d2cea5aa934b530fdd8d6f4e7c1 (patch)
tree969c0909c3ca08b2e376cb9b6a4eff4e21078da4 /LUFA/Drivers/USB/Class/Host/Audio.h
parent6e2a3174a5e08528299c208bf9415beccf43840a (diff)
downloadlufa-6e0a26083ad76d2cea5aa934b530fdd8d6f4e7c1.tar.gz
lufa-6e0a26083ad76d2cea5aa934b530fdd8d6f4e7c1.tar.bz2
lufa-6e0a26083ad76d2cea5aa934b530fdd8d6f4e7c1.zip
Fix bugs in the Host mode Audio class driver.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/Audio.h')
-rw-r--r--LUFA/Drivers/USB/Class/Host/Audio.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/Audio.h b/LUFA/Drivers/USB/Class/Host/Audio.h
index befcc2f59..26d537614 100644
--- a/LUFA/Drivers/USB/Class/Host/Audio.h
+++ b/LUFA/Drivers/USB/Class/Host/Audio.h
@@ -79,8 +79,14 @@
{
const struct
{
- uint8_t DataINPipeNumber; /**< Pipe number of the Audio interface's IN data pipe. */
- uint8_t DataOUTPipeNumber; /**< Pipe number of the Audio interface's OUT data pipe. */
+ uint8_t DataINPipeNumber; /**< Pipe number of the Audio interface's IN data pipe. If this interface should not
+ * bind to an IN endpoint, this may be set to 0 to disable audio input streaming for
+ * this driver instance.
+ */
+ uint8_t DataOUTPipeNumber; /**< Pipe number of the Audio interface's OUT data pipe. If this interface should not
+ * bind to an OUT endpoint, this may be set to 0 to disable audio output streaming for
+ * this driver instance.
+ */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
*/
@@ -325,10 +331,11 @@
{
Pipe_Write_8(Sample);
- if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)
+ if (!(Pipe_IsReadWriteAllowed()))
{
Pipe_Unfreeze();
Pipe_ClearOUT();
+ Pipe_WaitUntilReady();
Pipe_Freeze();
}
}
@@ -348,10 +355,11 @@
{
Pipe_Write_16_LE(Sample);
- if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)
+ if (!(Pipe_IsReadWriteAllowed()))
{
Pipe_Unfreeze();
Pipe_ClearOUT();
+ Pipe_WaitUntilReady();
Pipe_Freeze();
}
}
@@ -372,10 +380,11 @@
Pipe_Write_16_LE(Sample);
Pipe_Write_8(Sample >> 16);
- if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)
+ if (!(Pipe_IsReadWriteAllowed()))
{
Pipe_Unfreeze();
Pipe_ClearOUT();
+ Pipe_WaitUntilReady();
Pipe_Freeze();
}
}