         break;
     case MODE_TIME:
         sprintf(line1, "TIME FROM START:");
-        sprintf(line2, "%02ld:%02ld:%02ld        ", hours, minutes, seconds);
+        sprintf(line2, "%02ld:%02ld:%02ld        ", g_hours, g_minutes, g_seconds);
         break;
     case MODE_VOLTAGE:
         sprintf(line1, "%16s", "INPUT VOLTAGE:");
         sprintf(line2, "%16s", str_volt);
         break;
     case MODE_LCD_TIMER:
-        sprintf(line1, "%02ld:%02ld:%02ld   %d    ", hours, minutes, seconds, lcd_timer);
-        sprintf(line2, "LCD timeout %d       ", lcd_timeout);
+        sprintf(line1, "%02ld:%02ld:%02ld   %d    ", g_hours, g_minutes, g_seconds, g_lcd_timer);
+        sprintf(line2, "LCD timeout %d       ", g_lcd_timeout);
         break;
     case MODE_CHARGE:
-        sprintf(line1, "%16s", "CHARGE");
-        sprintf(line2, "%16s", str_volt);
+        {
+            if(g_charging || g_charged)
+            {
+                sprintf(line1, "C:  %8s mAh", str_mAh);
+            }
+            else
+            {
+                sprintf(line1, "%16s", "CHARGE");
+            }
+        }
+        if( g_charged )
+            sprintf(line2, "%6s  FINISHED", str_volt);
+        else
+            sprintf(line2, "%6s %6s mA", str_volt, str_mA);
         break;
     case MODE_DISCHARGE:
         {
-            if(discharging || discharged)
+            if( g_discharging || g_discharged )
             {
                 sprintf(line1, "D:  %8s mAh", str_mAh);
             }

    if ( mode == MODE_DISCHARGE)
    {
        if ( g_Buttons.up_button != 0 &&
            g_LastButtons.up_button == 0)
        {
            digitalWrite(3, HIGH);
            discharging = false;
        }
        if ( g_Buttons.bottom_button != 0 &&
            g_LastButtons.bottom_button == 0)
        {
            if( voltage >= 3.0 )
            {
                digitalWrite(3, LOW);
                discharging = true;
                dischargeStart = millis();
            }
        }
        if( voltage < 3.0 )
        {
            if( discharging )
            {
                discharged = true;
            }
            digitalWrite(3, HIGH);
            discharging = false;
        }
    }
    else if ( mode == MODE_CHARGE)
    {
        if ( g_Buttons.up_button != 0 &&
            g_LastButtons.up_button == 0)
        {
            digitalWrite(9, HIGH);
            discharging = false;
        }
        if ( g_Buttons.bottom_button != 0 &&
            g_LastButtons.bottom_button == 0)
        {
            digitalWrite(9, LOW);
            charging = true;
        }
    }
    else if ( mode == MODE_LCD_TIMER)
    {
        // Serial.write("mode timer");
        if ( g_Buttons.up_button != 0 &&
            g_LastButtons.up_button == 0)
        {
            lcd_timer = 0;
            if ( lcd_timeout == 0 )
                lcd_timeout++;
            lcd_timeout *= 2;
            if ( lcd_timeout > 255 )
                lcd_timeout = 0;
            light = 1;
            EEPROM.write(eeprom_address, lcd_timeout);
        }
    }

    if ( lcd_timer > lcd_timeout &&
        lcd_timeout > 0 &&
        charging == false &&
        discharging == false)
    {
        light = 0;
    }

char str_mAh[8];
char serial_buf1[20];
char serial_buf2[20];
char buffer[120];
int serial_buf_line_no = 1;

int eeprom_address = 0;
