Commit 6e2a3174 authored by Dean Camera's avatar Dean Camera
Browse files

Fix errors in the library Host mode Audio Class driver.

parent e5e34f91
......@@ -213,11 +213,11 @@ uint8_t Audio_GetSetEndpointProperty(USB_ClassInfo_Audio_Host_t* const AudioInte
{
uint8_t RequestType;
uint8_t EndpointAddress;
if (EndpointProperty & 0x80)
RequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE);
RequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT);
else
RequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE);
RequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT);
Pipe_SelectPipe(DataPipeIndex);
EndpointAddress = Pipe_GetBoundEndpointAddress();
......@@ -233,7 +233,7 @@ uint8_t Audio_GetSetEndpointProperty(USB_ClassInfo_Audio_Host_t* const AudioInte
Pipe_SelectPipe(PIPE_CONTROLPIPE);
return USB_Host_SendControlRequest(Data);
return USB_Host_SendControlRequest(Data);
}
#endif
......
......@@ -194,10 +194,11 @@
bool SampleReceived = false;
Pipe_SelectPipe(AudioInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_SelectPipe(AudioInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
SampleReceived = Pipe_IsINReceived();
Pipe_Freeze();
return SampleReceived;
}
......@@ -218,7 +219,7 @@
if ((USB_HostState != HOST_STATE_Configured) || !(AudioInterfaceInfo->State.IsActive))
return false;
Pipe_SelectPipe(AudioInterfaceInfo->Config.DataINPipeNumber);
Pipe_SelectPipe(AudioInterfaceInfo->Config.DataOUTPipeNumber);
return Pipe_IsOUTReady();
}
......@@ -324,7 +325,7 @@
{
Pipe_Write_8(Sample);
if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataINPipeSize)
if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)
{
Pipe_Unfreeze();
Pipe_ClearOUT();
......@@ -347,7 +348,7 @@
{
Pipe_Write_16_LE(Sample);
if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataINPipeSize)
if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)
{
Pipe_Unfreeze();
Pipe_ClearOUT();
......@@ -371,7 +372,7 @@
Pipe_Write_16_LE(Sample);
Pipe_Write_8(Sample >> 16);
if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataINPipeSize)
if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)
{
Pipe_Unfreeze();
Pipe_ClearOUT();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment