Allow larger SPLIT_USB_TIMEOUT with default SPLIT_USB_TIMEOUT_POLL (#17272)
* Switch SPLIT_USB_DETECT loop to uint16_t * Add assertion
This commit is contained in:
		
							parent
							
								
									f9e97fd3c3
								
							
						
					
					
						commit
						af02baae78
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -57,8 +57,9 @@ static uint8_t connection_errors = 0;
 | 
			
		|||
volatile bool isLeftHand = true;
 | 
			
		||||
 | 
			
		||||
#if defined(SPLIT_USB_DETECT)
 | 
			
		||||
_Static_assert((SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL) <= UINT16_MAX, "Please lower SPLIT_USB_TIMEOUT and/or increase SPLIT_USB_TIMEOUT_POLL.");
 | 
			
		||||
static bool usbIsActive(void) {
 | 
			
		||||
    for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) {
 | 
			
		||||
    for (uint16_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) {
 | 
			
		||||
        // This will return true if a USB connection has been established
 | 
			
		||||
        if (usb_connected_state()) {
 | 
			
		||||
            return true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue