From f27683bba76d420432e0f64ba25a50ece306a0d0 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Mon, 22 Aug 2011 01:40:25 +0200 Subject: [PATCH] Don't display comment if charging. Suggested multiple times, Also: issue#6 --- firmware/l0dable/voltage.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/firmware/l0dable/voltage.c b/firmware/l0dable/voltage.c index 70a5266..3a9ca5f 100644 --- a/firmware/l0dable/voltage.c +++ b/firmware/l0dable/voltage.c @@ -12,15 +12,18 @@ /**************************************************************************/ void ram(void) { - int v,mv; + int v,mv,c; do{ lcdClear(); lcdPrintln("Battery status:"); + c=gpioGetValue(RB_PWR_CHRG); mv=GetVoltage(); v=mv/1000; lcdNl(); - if (mv<3550){ + if(!c){ + lcdPrintln("CHARGING"); + }else if (mv<3550){ lcdPrintln(" Charge NOW!"); }else if (mv<3650){ lcdPrintln(" Charge soon"); @@ -40,10 +43,8 @@ void ram(void) { lcdPrintln("V"); lcdNl(); - if(gpioGetValue(RB_PWR_CHRG)){ + if(c){ lcdPrintln("(not charging)"); - }else{ - lcdPrintln("CHARGING"); }; lcdRefresh(); } while ((getInputWaitTimeout(242))==BTN_NONE);