forked from len0rd/rockbox
Reset the power history with the latest value when starting charging
so that we don't use values before discharge for the long-term delta calculation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1899 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b1d5124434
commit
fdb44c9175
1 changed files with 5 additions and 0 deletions
|
|
@ -211,6 +211,11 @@ static void power_thread(void)
|
||||||
DEBUGF("power: charger inserted and battery not full, enabling\n");
|
DEBUGF("power: charger inserted and battery not full, enabling\n");
|
||||||
charger_enable(true);
|
charger_enable(true);
|
||||||
charged_time = 0;
|
charged_time = 0;
|
||||||
|
/* clear the power history so that we don't use values before
|
||||||
|
* discharge for the long-term delta
|
||||||
|
*/
|
||||||
|
for (i = 0; i < POWER_HISTORY_LEN-1; i++)
|
||||||
|
power_history[i] = power_history[POWER_HISTORY_LEN-1];
|
||||||
snprintf(power_message, POWER_MESSAGE_LEN, "Chg started at %d%%", battery_level());
|
snprintf(power_message, POWER_MESSAGE_LEN, "Chg started at %d%%", battery_level());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue