Fix WAIT_FOR_USB handling (#23598)
This commit is contained in:
		
							parent
							
								
									c8ceda461a
								
							
						
					
					
						commit
						16cca527a6
					
				
					 14 changed files with 27 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -51,6 +51,11 @@
 | 
			
		|||
 | 
			
		||||
#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED (2U)
 | 
			
		||||
 | 
			
		||||
#ifdef WAIT_FOR_USB
 | 
			
		||||
// TODO: Remove backwards compatibility with old define
 | 
			
		||||
#    define USB_WAIT_FOR_ENUMERATION
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* -------------------------
 | 
			
		||||
 *   TMK host driver defs
 | 
			
		||||
 * -------------------------
 | 
			
		||||
| 
						 | 
				
			
			@ -143,7 +148,7 @@ void protocol_pre_init(void) {
 | 
			
		|||
 | 
			
		||||
    /* Wait until USB is active */
 | 
			
		||||
    while (true) {
 | 
			
		||||
#if defined(WAIT_FOR_USB)
 | 
			
		||||
#if defined(USB_WAIT_FOR_ENUMERATION)
 | 
			
		||||
        if (USB_DRIVER.state == USB_ACTIVE) {
 | 
			
		||||
            driver = &chibios_driver;
 | 
			
		||||
            break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,6 +67,11 @@
 | 
			
		|||
#    include "raw_hid.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef WAIT_FOR_USB
 | 
			
		||||
// TODO: Remove backwards compatibility with old define
 | 
			
		||||
#    define USB_WAIT_FOR_ENUMERATION
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
uint8_t keyboard_idle = 0;
 | 
			
		||||
/* 0: Boot Protocol, 1: Report Protocol(default) */
 | 
			
		||||
uint8_t        keyboard_protocol  = 1;
 | 
			
		||||
| 
						 | 
				
			
			@ -807,7 +812,7 @@ void protocol_pre_init(void) {
 | 
			
		|||
 | 
			
		||||
    /* wait for USB startup & debug output */
 | 
			
		||||
 | 
			
		||||
#ifdef WAIT_FOR_USB
 | 
			
		||||
#ifdef USB_WAIT_FOR_ENUMERATION
 | 
			
		||||
    while (USB_DeviceState != DEVICE_STATE_Configured) {
 | 
			
		||||
#    if defined(INTERRUPT_CONTROL_ENDPOINT)
 | 
			
		||||
        ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue