summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
authorUwe Freese <thebreaker@rockbox.org>2002-12-16 22:58:48 +0000
committerUwe Freese <thebreaker@rockbox.org>2002-12-16 22:58:48 +0000
commit0bf70e65e8b61fceb4b2833277b36ba3ad14fdbf (patch)
tree20e05355105f0bbbddef5a20a4cbbc7d01013364 /firmware/powermgmt.c
parentae1ba1d5de779ff66d5a86bfb6c5326f3e902ac3 (diff)
battery capacity (1500-2400 in 50mAh steps) saved to disk
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3008 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 7dcecb1e68..febcb78a5a 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -73,9 +73,9 @@ int battery_capacity = 1500; /* only a default value */
void set_battery_capacity(int capacity)
{
- int values[8] = {1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200};
-
- battery_capacity = values[capacity];
+ battery_capacity = capacity;
+ if ((battery_capacity > BATTERY_CAPACITY_MAX) || (battery_capacity < 1500))
+ battery_capacity = 1500;
}
#ifdef HAVE_CHARGE_CTRL