From 82fd0d1138ae4110eeb7303e841869b161cad968 Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Fri, 5 Oct 2007 23:18:51 +0200 Subject: [PATCH] cleanups --- lipo-charger.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lipo-charger.c b/lipo-charger.c index 17bec29..b69e2ed 100644 --- a/lipo-charger.c +++ b/lipo-charger.c @@ -195,6 +195,7 @@ ISR(ADC_vect) ADMUX = CH1; } + /* start ADC again */ ADCSRA |= (1< 12450 || current > 16000) if (pwm > 0x00) pwm--; - } else { - pwm = 0; - } - if (pwm > 0) { OCR1A = pwm; TCCR1A |= (1< 9V is detected (lipo connected) - */ + /* start charging when a voltage > 9V is detected (lipo connected) */ if (voltage > 9000) mode = MOD_CHARGING; break; case MOD_CHARGING: - /* - * end charging if voltage > 12.42V and current < 200mA - */ + /* end charging if voltage > 12.42V and current < 200mA */ if (voltage > 12425 && current < 2000) mode = MOD_READY; break;