mirror of
				https://github.com/mfulz/qmk_firmware.git
				synced 2025-10-30 21:02:32 +01:00 
			
		
		
		
	Fixed possible enumeration error if the user application selects the non-Control pipe between the Powered and Default states of the host state machine.
This commit is contained in:
		
							parent
							
								
									7cbea39c42
								
							
						
					
					
						commit
						8a9e30a0cb
					
				
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -111,11 +111,9 @@ void USB_Host_ProcessNextHostState(void) | |||||||
| 			HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Powered_ConfigPipe); | 			HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Powered_ConfigPipe); | ||||||
| 			break; | 			break; | ||||||
| 		case HOST_STATE_Powered_ConfigPipe: | 		case HOST_STATE_Powered_ConfigPipe: | ||||||
| 			Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, | 			if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, | ||||||
| 			                         PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, | 			                         PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, | ||||||
| 							   PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE); | 			                         PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE))) | ||||||
| 
 |  | ||||||
| 			if (!(Pipe_IsConfigured())) |  | ||||||
| 			{ | 			{ | ||||||
| 				ErrorCode    = HOST_ENUMERROR_PipeConfigError; | 				ErrorCode    = HOST_ENUMERROR_PipeConfigError; | ||||||
| 				SubErrorCode = 0; | 				SubErrorCode = 0; | ||||||
| @ -136,6 +134,7 @@ void USB_Host_ProcessNextHostState(void) | |||||||
| 
 | 
 | ||||||
| 			uint8_t DataBuffer[8]; | 			uint8_t DataBuffer[8]; | ||||||
| 
 | 
 | ||||||
|  | 			Pipe_SelectPipe(PIPE_CONTROLPIPE); | ||||||
| 			if ((SubErrorCode = USB_Host_SendControlRequest(DataBuffer)) != HOST_SENDCONTROL_Successful) | 			if ((SubErrorCode = USB_Host_SendControlRequest(DataBuffer)) != HOST_SENDCONTROL_Successful) | ||||||
| 			{ | 			{ | ||||||
| 				ErrorCode = HOST_ENUMERROR_ControlError; | 				ErrorCode = HOST_ENUMERROR_ControlError; | ||||||
| @ -149,11 +148,9 @@ void USB_Host_ProcessNextHostState(void) | |||||||
| 			HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset); | 			HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset); | ||||||
| 			break; | 			break; | ||||||
| 		case HOST_STATE_Default_PostReset: | 		case HOST_STATE_Default_PostReset: | ||||||
| 			Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, | 			if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, | ||||||
| 			                         PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, | 			                         PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, | ||||||
| 			                   USB_Host_ControlPipeSize, PIPE_BANK_SINGLE); | 			                         USB_Host_ControlPipeSize, PIPE_BANK_SINGLE))) | ||||||
| 
 |  | ||||||
| 			if (!(Pipe_IsConfigured())) |  | ||||||
| 			{ | 			{ | ||||||
| 				ErrorCode    = HOST_ENUMERROR_PipeConfigError; | 				ErrorCode    = HOST_ENUMERROR_PipeConfigError; | ||||||
| 				SubErrorCode = 0; | 				SubErrorCode = 0; | ||||||
|  | |||||||
| @ -111,11 +111,9 @@ void USB_Host_ProcessNextHostState(void) | |||||||
| 			HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Powered_ConfigPipe); | 			HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Powered_ConfigPipe); | ||||||
| 			break; | 			break; | ||||||
| 		case HOST_STATE_Powered_ConfigPipe: | 		case HOST_STATE_Powered_ConfigPipe: | ||||||
| 			Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, | 			if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, | ||||||
| 							         PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, | 							         PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, | ||||||
| 							   PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE); | 							         PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE))) | ||||||
| 
 |  | ||||||
| 			if (!(Pipe_IsConfigured())) |  | ||||||
| 			{ | 			{ | ||||||
| 				ErrorCode    = HOST_ENUMERROR_PipeConfigError; | 				ErrorCode    = HOST_ENUMERROR_PipeConfigError; | ||||||
| 				SubErrorCode = 0; | 				SubErrorCode = 0; | ||||||
| @ -136,6 +134,7 @@ void USB_Host_ProcessNextHostState(void) | |||||||
| 
 | 
 | ||||||
| 			uint8_t DataBuffer[8]; | 			uint8_t DataBuffer[8]; | ||||||
| 
 | 
 | ||||||
|  | 			Pipe_SelectPipe(PIPE_CONTROLPIPE); | ||||||
| 			if ((SubErrorCode = USB_Host_SendControlRequest(DataBuffer)) != HOST_SENDCONTROL_Successful) | 			if ((SubErrorCode = USB_Host_SendControlRequest(DataBuffer)) != HOST_SENDCONTROL_Successful) | ||||||
| 			{ | 			{ | ||||||
| 				ErrorCode = HOST_ENUMERROR_ControlError; | 				ErrorCode = HOST_ENUMERROR_ControlError; | ||||||
| @ -149,11 +148,9 @@ void USB_Host_ProcessNextHostState(void) | |||||||
| 			HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset); | 			HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset); | ||||||
| 			break; | 			break; | ||||||
| 		case HOST_STATE_Default_PostReset: | 		case HOST_STATE_Default_PostReset: | ||||||
| 			Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, | 			if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, | ||||||
| 			                         PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, | 			                         PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, | ||||||
| 			                   USB_Host_ControlPipeSize, PIPE_BANK_SINGLE); | 			                         USB_Host_ControlPipeSize, PIPE_BANK_SINGLE))) | ||||||
| 
 |  | ||||||
| 			if (!(Pipe_IsConfigured())) |  | ||||||
| 			{ | 			{ | ||||||
| 				ErrorCode    = HOST_ENUMERROR_PipeConfigError; | 				ErrorCode    = HOST_ENUMERROR_PipeConfigError; | ||||||
| 				SubErrorCode = 0; | 				SubErrorCode = 0; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Dean Camera
						Dean Camera