Fix FS#12555: Use smoothed battery voltage for level and runtime calculation

The debug screen gets un-smoothed battery status via battery_read_info().
The level and runtime that is normally presented to the user needs to be
based on smoothed voltage.

Change-Id: Icb448853973aa1d5832e9094176938cfa12b2e48
This commit is contained in:
Boris Gjenero 2012-01-21 12:10:31 -05:00
parent c7f3a0b360
commit 109084d5cb

View file

@ -281,8 +281,11 @@ static int voltage_to_battery_level(int battery_millivolts)
static void battery_status_update(void)
{
int millivolt, level;
battery_read_info(&millivolt, &level);
int millivolt = battery_voltage();
int level = _battery_level();
if (level < 0)
level = voltage_to_battery_level(millivolt);
#ifdef CURRENT_NORMAL /*don't try to estimate run or charge
time without normal current defined*/