Don't display comment if charging.

Suggested multiple times, Also: issue#6
This commit is contained in:
Stefan `Sec` Zehl 2011-08-22 01:40:25 +02:00
parent bcd9978198
commit f27683bba7
1 changed files with 6 additions and 5 deletions

View File

@ -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);