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:
parent
c7f3a0b360
commit
109084d5cb
1 changed files with 5 additions and 2 deletions
|
@ -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*/
|
||||
|
|
Loading…
Reference in a new issue