mirror of
				https://github.com/mfulz/qmk_firmware.git
				synced 2025-11-04 07:12:33 +01:00 
			
		
		
		
	Add connection indicator
This commit is contained in:
		
							parent
							
								
									f441ad07cc
								
							
						
					
					
						commit
						e4b9541041
					
				@ -58,10 +58,10 @@ static void battery_led(bool on)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    if (on) {
 | 
					    if (on) {
 | 
				
			||||||
        DDRF  |=  (1<<5);
 | 
					        DDRF  |=  (1<<5);
 | 
				
			||||||
        PORTF &= ~(1<<5);
 | 
					        PORTF &= ~(1<<5);   // Low
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        DDRF  &= ~(1<<5);
 | 
					        DDRF  &= ~(1<<5);
 | 
				
			||||||
        PORTF |=  (1<<5);
 | 
					        PORTF &= ~(1<<5);   // HiZ
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -80,9 +80,9 @@ void rn42_task_init(void)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    battery_adc_init();
 | 
					    battery_adc_init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // battery charging(input with pull-up)
 | 
					    // battery charging(HiZ)
 | 
				
			||||||
    DDRF  &= ~(1<<5);
 | 
					    DDRF  &= ~(1<<5);
 | 
				
			||||||
    PORTF |=  (1<<5);
 | 
					    PORTF &= ~(1<<5);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void rn42_task(void)
 | 
					void rn42_task(void)
 | 
				
			||||||
@ -135,6 +135,15 @@ void rn42_task(void)
 | 
				
			|||||||
            host_set_driver(&lufa_driver);
 | 
					            host_set_driver(&lufa_driver);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Battery monitor */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Connection monitor */
 | 
				
			||||||
 | 
					    if (rn42_linked()) {
 | 
				
			||||||
 | 
					        status_led(true);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					        status_led(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user