mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-11 06:29:15 +00:00
Add wait for charging capacitance of ADC S/H
This commit is contained in:
parent
2d7973fc3f
commit
86f82dd02d
1 changed files with 1 additions and 0 deletions
|
@ -92,6 +92,7 @@ uint16_t battery_voltage(void)
|
|||
|
||||
volatile uint16_t bat;
|
||||
ADCSRA |= (1<<ADEN);
|
||||
_delay_ms(1); // wait for charging S/H capacitance
|
||||
|
||||
ADCSRA |= (1<<ADSC);
|
||||
while (ADCSRA & (1<<ADSC)) ;
|
||||
|
|
Loading…
Reference in a new issue