forked from mfulz_github/qmk_firmware
		
	Fixed CDCHost not clearing configured endpoints and resetting configured endpoints mask when a partially enumerated invalid CDC interface is skipped.
This commit is contained in:
		
							parent
							
								
									32f0f605ef
								
							
						
					
					
						commit
						fabfdd454a
					
				@ -113,10 +113,6 @@ EVENT_HANDLER(USB_Disconnect)
 | 
				
			|||||||
EVENT_HANDLER(USB_ConfigurationChanged)
 | 
					EVENT_HANDLER(USB_ConfigurationChanged)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	/* Setup CDC Notification, Rx and Tx Endpoints */
 | 
						/* Setup CDC Notification, Rx and Tx Endpoints */
 | 
				
			||||||
	Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
 | 
					 | 
				
			||||||
		                       ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
 | 
					 | 
				
			||||||
	                           ENDPOINT_BANK_SINGLE);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
 | 
						Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
 | 
				
			||||||
		                       ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
 | 
							                       ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
 | 
				
			||||||
	                           ENDPOINT_BANK_SINGLE);
 | 
						                           ENDPOINT_BANK_SINGLE);
 | 
				
			||||||
@ -125,6 +121,10 @@ EVENT_HANDLER(USB_ConfigurationChanged)
 | 
				
			|||||||
		                       ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
 | 
							                       ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
 | 
				
			||||||
	                           ENDPOINT_BANK_SINGLE);
 | 
						                           ENDPOINT_BANK_SINGLE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
 | 
				
			||||||
 | 
							                       ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
 | 
				
			||||||
 | 
						                           ENDPOINT_BANK_SINGLE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Indicate USB connected and ready */
 | 
						/* Indicate USB connected and ready */
 | 
				
			||||||
	UpdateStatus(Status_USBReady);
 | 
						UpdateStatus(Status_USBReady);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -95,6 +95,14 @@ uint8_t ProcessConfigurationDescriptor(void)
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
 | 
									/* Clear the found endpoints mask, since any already processed endpoints aren't in the CDC interface we need */
 | 
				
			||||||
 | 
									FoundEndpoints = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									/* Disable any already configured endpoints from the invalid CDC interfaces */
 | 
				
			||||||
 | 
									Endpoint_DisableEndpoint(CDC_NOTIFICATIONPIPE);
 | 
				
			||||||
 | 
									Endpoint_DisableEndpoint(CDC_DATAPIPE_IN);
 | 
				
			||||||
 | 
									Endpoint_DisableEndpoint(CDC_DATAPIPE_OUT);
 | 
				
			||||||
 | 
								
 | 
				
			||||||
				/* Get the next CDC control interface from the configuration descriptor (CDC class has two CDC interfaces) */
 | 
									/* Get the next CDC control interface from the configuration descriptor (CDC class has two CDC interfaces) */
 | 
				
			||||||
				if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextCDCControlInterface))
 | 
									if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextCDCControlInterface))
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
 | 
				
			|||||||
@ -15,6 +15,8 @@
 | 
				
			|||||||
  *  - Removed support for endpoint/pipe non-control interrupts; these did not act in the way users expected, and had many subtle issues
 | 
					  *  - Removed support for endpoint/pipe non-control interrupts; these did not act in the way users expected, and had many subtle issues
 | 
				
			||||||
  *  - Fixed Device Mode not handling Set Feature and Clear Feature Chapter 9 requests that are addressed to the device (thanks to Brian Dickman)
 | 
					  *  - Fixed Device Mode not handling Set Feature and Clear Feature Chapter 9 requests that are addressed to the device (thanks to Brian Dickman)
 | 
				
			||||||
  *  - Moved control endpoint interrupt handling into the library itself, enable via the new INTERRUPT_CONTROL_ENDPOINT token
 | 
					  *  - Moved control endpoint interrupt handling into the library itself, enable via the new INTERRUPT_CONTROL_ENDPOINT token
 | 
				
			||||||
 | 
					  *  - Fixed CDCHost not clearing configured endpoints and resetting configured endpoints mask when a partially enumerated invalid CDC
 | 
				
			||||||
 | 
					  *    interface is skipped
 | 
				
			||||||
  *
 | 
					  *
 | 
				
			||||||
  *
 | 
					  *
 | 
				
			||||||
  *  \section Sec_ChangeLog090510 Version 090510
 | 
					  *  \section Sec_ChangeLog090510 Version 090510
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user