Only reset battery level if battery type really changed.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5734 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-02-01 18:00:15 +00:00
parent f2a5439cea
commit 0457a578b5

View file

@ -121,9 +121,11 @@ static int battery_type = 0;
void set_battery_type(int type) void set_battery_type(int type)
{ {
if (type != battery_type) {
battery_type = type; battery_type = type;
battery_level_cached = -1; /* reset on type change */ battery_level_cached = -1; /* reset on type change */
} }
}
#endif #endif
#if defined(HAVE_CHARGE_CTRL) || CONFIG_BATTERY == BATT_LIION2200 #if defined(HAVE_CHARGE_CTRL) || CONFIG_BATTERY == BATT_LIION2200