aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r--LUFA/Drivers/USB/Class/Host/Audio.c2
-rw-r--r--LUFA/Drivers/USB/Class/Host/Audio.h47
2 files changed, 39 insertions, 10 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/Audio.c b/LUFA/Drivers/USB/Class/Host/Audio.c
index 0da1eb664..80ab2d1e5 100644
--- a/LUFA/Drivers/USB/Class/Host/Audio.c
+++ b/LUFA/Drivers/USB/Class/Host/Audio.c
@@ -209,7 +209,7 @@ uint8_t Audio_GetSetEndpointProperty(USB_ClassInfo_Audio_Host_t* const AudioInte
const uint8_t EndpointProperty,
const uint8_t EndpointControl,
uint16_t const DataLength,
- uint8_t* Data)
+ void* const Data)
{
uint8_t RequestType;
uint8_t EndpointAddress;
diff --git a/LUFA/Drivers/USB/Class/Host/Audio.h b/LUFA/Drivers/USB/Class/Host/Audio.h
index 7e9a48d89..1cac3e7ac 100644
--- a/LUFA/Drivers/USB/Class/Host/Audio.h
+++ b/LUFA/Drivers/USB/Class/Host/Audio.h
@@ -159,8 +159,8 @@
const uint8_t DataPipeIndex,
const uint8_t EndpointProperty,
const uint8_t EndpointControl,
- uint16_t* const DataLength,
- uint8_t* Data);
+ uint16_t const DataLength,
+ void* const Data);
/* Inline Functions: */
/** General management task for a given Audio host class interface, required for the correct operation of
@@ -192,8 +192,13 @@
if ((USB_HostState != HOST_STATE_Configured) || !(AudioInterfaceInfo->State.IsActive))
return false;
+ bool SampleReceived = false;
+
Pipe_SelectPipe(AudioInterfaceInfo->Config.DataOUTPipeNumber);
- return Pipe_IsINReceived();
+ Pipe_Unfreeze();
+ SampleReceived = Pipe_IsINReceived();
+ Pipe_Freeze();
+ return SampleReceived;
}
/** Determines if the given audio interface is ready to accept the next sample to be written to it, and selects
@@ -237,7 +242,11 @@
Sample = Pipe_Read_8();
if (!(Pipe_BytesInPipe()))
- Pipe_ClearIN();
+ {
+ Pipe_Unfreeze();
+ Pipe_ClearIN();
+ Pipe_Freeze();
+ }
return Sample;
}
@@ -262,7 +271,11 @@
Sample = (int16_t)Pipe_Read_16_LE();
if (!(Pipe_BytesInPipe()))
- Pipe_ClearIN();
+ {
+ Pipe_Unfreeze();
+ Pipe_ClearIN();
+ Pipe_Freeze();
+ }
return Sample;
}
@@ -287,7 +300,11 @@
Sample = (((uint32_t)Pipe_Read_8() << 16) | Pipe_Read_16_LE());
if (!(Pipe_BytesInPipe()))
- Pipe_ClearIN();
+ {
+ Pipe_Unfreeze();
+ Pipe_ClearIN();
+ Pipe_Freeze();
+ }
return Sample;
}
@@ -308,7 +325,11 @@
Pipe_Write_8(Sample);
if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataINPipeSize)
- Pipe_ClearOUT();
+ {
+ Pipe_Unfreeze();
+ Pipe_ClearOUT();
+ Pipe_Freeze();
+ }
}
/** Writes the next 16-bit audio sample to the current audio interface.
@@ -327,7 +348,11 @@
Pipe_Write_16_LE(Sample);
if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataINPipeSize)
- Pipe_ClearOUT();
+ {
+ Pipe_Unfreeze();
+ Pipe_ClearOUT();
+ Pipe_Freeze();
+ }
}
/** Writes the next 24-bit audio sample to the current audio interface.
@@ -347,7 +372,11 @@
Pipe_Write_8(Sample >> 16);
if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataINPipeSize)
- Pipe_ClearOUT();
+ {
+ Pipe_Unfreeze();
+ Pipe_ClearOUT();
+ Pipe_Freeze();
+ }
}
/* Private Interface - For use in library only: */