summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortmk <hasu@tmk-kbd.com>2014-12-03 14:22:10 +0900
committertmk <hasu@tmk-kbd.com>2015-01-15 17:08:48 +0900
commit86f82dd02db577cd658ca4284cae15e9664db0f2 (patch)
tree644c507981cc1e81f7f453bf9adca32fc94b894f
parent2d7973fc3fa27b74379ba08392e2487e208b770a (diff)
Add wait for charging capacitance of ADC S/H
-rw-r--r--keyboard/hhkb_rn42/rn42/battery.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/keyboard/hhkb_rn42/rn42/battery.c b/keyboard/hhkb_rn42/rn42/battery.c
index 34aa18446c..7e868c9646 100644
--- a/keyboard/hhkb_rn42/rn42/battery.c
+++ b/keyboard/hhkb_rn42/rn42/battery.c
@@ -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)) ;