forked from mfulz_github/qmk_firmware
		
	Fix errors in the library Host mode Audio Class driver.
This commit is contained in:
		
							parent
							
								
									e5e34f91fa
								
							
						
					
					
						commit
						6e2a3174a5
					
				@ -213,11 +213,11 @@ uint8_t Audio_GetSetEndpointProperty(USB_ClassInfo_Audio_Host_t* const AudioInte
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	uint8_t RequestType;
 | 
						uint8_t RequestType;
 | 
				
			||||||
	uint8_t EndpointAddress;
 | 
						uint8_t EndpointAddress;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	if (EndpointProperty & 0x80)
 | 
						if (EndpointProperty & 0x80)
 | 
				
			||||||
	  RequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE);
 | 
						  RequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
	  RequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE);	
 | 
						  RequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT);
 | 
				
			||||||
	  
 | 
						  
 | 
				
			||||||
	Pipe_SelectPipe(DataPipeIndex);
 | 
						Pipe_SelectPipe(DataPipeIndex);
 | 
				
			||||||
	EndpointAddress = Pipe_GetBoundEndpointAddress();
 | 
						EndpointAddress = Pipe_GetBoundEndpointAddress();
 | 
				
			||||||
@ -233,7 +233,7 @@ uint8_t Audio_GetSetEndpointProperty(USB_ClassInfo_Audio_Host_t* const AudioInte
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	Pipe_SelectPipe(PIPE_CONTROLPIPE);
 | 
						Pipe_SelectPipe(PIPE_CONTROLPIPE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return USB_Host_SendControlRequest(Data);	
 | 
						return USB_Host_SendControlRequest(Data);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
@ -194,10 +194,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
				bool SampleReceived = false;
 | 
									bool SampleReceived = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				Pipe_SelectPipe(AudioInterfaceInfo->Config.DataOUTPipeNumber);
 | 
									Pipe_SelectPipe(AudioInterfaceInfo->Config.DataINPipeNumber);
 | 
				
			||||||
				Pipe_Unfreeze();
 | 
									Pipe_Unfreeze();
 | 
				
			||||||
				SampleReceived = Pipe_IsINReceived();
 | 
									SampleReceived = Pipe_IsINReceived();
 | 
				
			||||||
				Pipe_Freeze();
 | 
									Pipe_Freeze();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				return SampleReceived;
 | 
									return SampleReceived;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -218,7 +219,7 @@
 | 
				
			|||||||
				if ((USB_HostState != HOST_STATE_Configured) || !(AudioInterfaceInfo->State.IsActive))
 | 
									if ((USB_HostState != HOST_STATE_Configured) || !(AudioInterfaceInfo->State.IsActive))
 | 
				
			||||||
				  return false;
 | 
									  return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				Pipe_SelectPipe(AudioInterfaceInfo->Config.DataINPipeNumber);
 | 
									Pipe_SelectPipe(AudioInterfaceInfo->Config.DataOUTPipeNumber);
 | 
				
			||||||
				return Pipe_IsOUTReady();
 | 
									return Pipe_IsOUTReady();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -324,7 +325,7 @@
 | 
				
			|||||||
			{
 | 
								{
 | 
				
			||||||
				Pipe_Write_8(Sample);
 | 
									Pipe_Write_8(Sample);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataINPipeSize)
 | 
									if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					Pipe_Unfreeze();
 | 
										Pipe_Unfreeze();
 | 
				
			||||||
					Pipe_ClearOUT();
 | 
										Pipe_ClearOUT();
 | 
				
			||||||
@ -347,7 +348,7 @@
 | 
				
			|||||||
			{
 | 
								{
 | 
				
			||||||
				Pipe_Write_16_LE(Sample);
 | 
									Pipe_Write_16_LE(Sample);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataINPipeSize)
 | 
									if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					Pipe_Unfreeze();
 | 
										Pipe_Unfreeze();
 | 
				
			||||||
					Pipe_ClearOUT();
 | 
										Pipe_ClearOUT();
 | 
				
			||||||
@ -371,7 +372,7 @@
 | 
				
			|||||||
				Pipe_Write_16_LE(Sample);
 | 
									Pipe_Write_16_LE(Sample);
 | 
				
			||||||
				Pipe_Write_8(Sample >> 16);
 | 
									Pipe_Write_8(Sample >> 16);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataINPipeSize)
 | 
									if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					Pipe_Unfreeze();
 | 
										Pipe_Unfreeze();
 | 
				
			||||||
					Pipe_ClearOUT();
 | 
										Pipe_ClearOUT();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user