for (i=0; i < POWER_HISTORY_LEN-1; i++) {
y1 = (power_history[POWER_HISTORY_LEN-1-i] - minv) * BAT_YSPACE /
(maxv - minv);
yg1 = MIN(MAX(LCD_HEIGHT-1 - y1, 20),
LCD_HEIGHT-1);
y2 = (power_history[POWER_HISTORY_LEN-1-i-1] - minv) * BAT_YSPACE /
(maxv - minv);
yg2 = MIN(MAX(LCD_HEIGHT-1 - y2, 20),
LCD_HEIGHT-1);

lcd_set_drawmode(DRMODE_SOLID);

lcd_drawline(((i*LCD_WIDTH)/POWER_HISTORY_LEN), yg1,
(((i+1)*LCD_WIDTH)/POWER_HISTORY_LEN), yg2);
//lcd_drawline(i, yg1, i+1, yg2);
}