Fix CDC blocking streams in Host mode locking up when the device is removed.
This commit is contained in:
		
							parent
							
								
									71e5bcee3d
								
							
						
					
					
						commit
						1e1cf2c499
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -445,6 +445,9 @@ static int CDC_Host_getchar_Blocking(FILE* Stream)
 | 
			
		|||
{
 | 
			
		||||
	while (!(CDC_Host_BytesReceived((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream))))
 | 
			
		||||
	{
 | 
			
		||||
		if (USB_HostState == HOST_STATE_Unattached)
 | 
			
		||||
		  return _FDEV_EOF;
 | 
			
		||||
 | 
			
		||||
		CDC_Host_USBTask((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream));
 | 
			
		||||
		USB_USBTask();
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue