Fixed Device mode HID Class driver not explicitly initializing the ReportSize parameter to zero before calling callback routine, so that ignored callbacks don't cause incorrect data to be sent.
This commit is contained in:
		
							parent
							
								
									922e60192d
								
							
						
					
					
						commit
						94c899d7b7
					
				
					 3 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -48,8 +48,8 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
 | 
			
		|||
			{
 | 
			
		||||
				Endpoint_ClearSETUP();	
 | 
			
		||||
 | 
			
		||||
				uint16_t ReportINSize;
 | 
			
		||||
				uint8_t  ReportID = (USB_ControlRequest.wValue & 0xFF);
 | 
			
		||||
				uint16_t ReportINSize = 0;
 | 
			
		||||
				uint8_t  ReportID     = (USB_ControlRequest.wValue & 0xFF);
 | 
			
		||||
 | 
			
		||||
				memset(HIDInterfaceInfo->Config.PrevReportINBuffer, 0, HIDInterfaceInfo->Config.PrevReportINBufferSize);
 | 
			
		||||
				
 | 
			
		||||
| 
						 | 
				
			
			@ -151,8 +151,8 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
 | 
			
		|||
	if (Endpoint_IsReadWriteAllowed())
 | 
			
		||||
	{
 | 
			
		||||
		uint8_t  ReportINData[HIDInterfaceInfo->Config.PrevReportINBufferSize];
 | 
			
		||||
		uint8_t  ReportID = 0;
 | 
			
		||||
		uint16_t ReportINSize;
 | 
			
		||||
		uint8_t  ReportID     = 0;
 | 
			
		||||
		uint16_t ReportINSize = 0;
 | 
			
		||||
 | 
			
		||||
		memset(ReportINData, 0, sizeof(ReportINData));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue