forked from len0rd/rockbox
FS#8871 by Tomasz Wasilczyk, avoid negative runtime estimation (that would later be cast to an unsigned giving huge values
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17080 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ef97db1011
commit
02eb1d83a7
2 changed files with 5 additions and 0 deletions
|
@ -386,6 +386,7 @@ Andreas Müller
|
||||||
Christopher Williams
|
Christopher Williams
|
||||||
Martin Ritter
|
Martin Ritter
|
||||||
Justin Hannigan
|
Justin Hannigan
|
||||||
|
Tomasz Wasilczyk
|
||||||
|
|
||||||
|
|
||||||
The libmad team
|
The libmad team
|
||||||
|
|
|
@ -478,6 +478,10 @@ static void battery_status_update(void)
|
||||||
if ((battery_millivolts + 20) > percent_to_volt_discharge[0][0])
|
if ((battery_millivolts + 20) > percent_to_volt_discharge[0][0])
|
||||||
powermgmt_est_runningtime_min = (level + battery_percent) * 60 *
|
powermgmt_est_runningtime_min = (level + battery_percent) * 60 *
|
||||||
battery_capacity / 200 / runcurrent();
|
battery_capacity / 200 / runcurrent();
|
||||||
|
|
||||||
|
else if (battery_millivolts <= battery_level_shutoff[0])
|
||||||
|
powermgmt_est_runningtime_min = 0;
|
||||||
|
|
||||||
else
|
else
|
||||||
powermgmt_est_runningtime_min = (battery_millivolts -
|
powermgmt_est_runningtime_min = (battery_millivolts -
|
||||||
battery_level_shutoff[0]) / 2;
|
battery_level_shutoff[0]) / 2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue