diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-10-10 10:28:21 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-10-10 10:28:21 +0000 |
commit | fe32456fe0e8e8db0d747172de6af179f570545f (patch) | |
tree | d50b693a28efb8b75d214a1c612afdea1955abda | |
parent | ccfa4cd97af5fd8a4d4868d92cb616a7959b5fa2 (diff) | |
download | rockbox-fe32456fe0e8e8db0d747172de6af179f570545f.tar.gz rockbox-fe32456fe0e8e8db0d747172de6af179f570545f.zip |
Consistent battery capacity handling for settings and menu, adapted allowed range for Ondio
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5243 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/settings.c | 10 | ||||
-rw-r--r-- | apps/settings_menu.c | 3 | ||||
-rw-r--r-- | firmware/export/powermgmt.h | 7 |
3 files changed, 11 insertions, 9 deletions
diff --git a/apps/settings.c b/apps/settings.c index 2765ae8e52..bbb37db3f1 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -217,13 +217,9 @@ static const struct bit_entry rtc_bits[] = | |||
217 | {1, S_O(discharge), 0, "deep discharge", off_on }, | 217 | {1, S_O(discharge), 0, "deep discharge", off_on }, |
218 | {1, S_O(trickle_charge), true, "trickle charge", off_on }, | 218 | {1, S_O(trickle_charge), true, "trickle charge", off_on }, |
219 | #endif | 219 | #endif |
220 | #if CONFIG_BATTERY == BATT_LIION2200 | 220 | {12, S_O(battery_capacity), BATTERY_CAPACITY_MIN, "battery capacity", |
221 | {12, S_O(battery_capacity), 2200, "battery capacity", NULL }, /* 1500...3200 */ | 221 | NULL }, /* 1500...3200 for NiMH, 2200...3200 for LiIon, |
222 | #elif CONFIG_BATTERY == BATT_4AA_NIMH | 222 | 1000...2000 for Alkaline */ |
223 | {12, S_O(battery_capacity), 1500, "battery capacity", NULL }, /* 1500...3200 */ | ||
224 | #elif CONFIG_BATTERY == BATT_3AAA_ALKALINE | ||
225 | {12, S_O(battery_capacity), 1000, "battery capacity", NULL }, | ||
226 | #endif | ||
227 | #ifdef HAVE_CHARGING | 223 | #ifdef HAVE_CHARGING |
228 | {1, S_O(car_adapter_mode), false, "car adapter mode", off_on }, | 224 | {1, S_O(car_adapter_mode), false, "car adapter mode", off_on }, |
229 | #endif | 225 | #endif |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 2579d7b4dc..8877818d43 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -703,7 +703,8 @@ static bool battery_capacity(void) | |||
703 | { | 703 | { |
704 | return set_int(str(LANG_BATTERY_CAPACITY), "mAh", UNIT_MAH, | 704 | return set_int(str(LANG_BATTERY_CAPACITY), "mAh", UNIT_MAH, |
705 | &global_settings.battery_capacity, | 705 | &global_settings.battery_capacity, |
706 | &set_battery_capacity, 50, 1500, BATTERY_CAPACITY_MAX ); | 706 | &set_battery_capacity, 50, BATTERY_CAPACITY_MIN, |
707 | BATTERY_CAPACITY_MAX ); | ||
707 | } | 708 | } |
708 | #endif | 709 | #endif |
709 | 710 | ||
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h index 6ea4820b40..e3df2ebd15 100644 --- a/firmware/export/powermgmt.h +++ b/firmware/export/powermgmt.h | |||
@@ -24,20 +24,25 @@ | |||
24 | #define BATTERY_LEVEL_EMPTY 265 /* 2.65V */ | 24 | #define BATTERY_LEVEL_EMPTY 265 /* 2.65V */ |
25 | #define BATTERY_LEVEL_DANGEROUS 280 /* 2.80V */ | 25 | #define BATTERY_LEVEL_DANGEROUS 280 /* 2.80V */ |
26 | #define BATTERY_LEVEL_FULL 400 /* 4.00V */ | 26 | #define BATTERY_LEVEL_FULL 400 /* 4.00V */ |
27 | #define BATTERY_CAPACITY_MIN 2200 | ||
28 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable in settings */ | ||
27 | #elif CONFIG_BATTERY == BATT_3AAA_ALKALINE /* Ondio, Alkalines */ | 29 | #elif CONFIG_BATTERY == BATT_3AAA_ALKALINE /* Ondio, Alkalines */ |
28 | #define BATTERY_LEVEL_SHUTDOWN 250 /* 2.50V */ | 30 | #define BATTERY_LEVEL_SHUTDOWN 250 /* 2.50V */ |
29 | #define BATTERY_LEVEL_EMPTY 260 /* 2.60V */ | 31 | #define BATTERY_LEVEL_EMPTY 260 /* 2.60V */ |
30 | #define BATTERY_LEVEL_DANGEROUS 270 /* 2.80V */ | 32 | #define BATTERY_LEVEL_DANGEROUS 270 /* 2.80V */ |
31 | #define BATTERY_LEVEL_FULL 450 /* 4.50V */ | 33 | #define BATTERY_LEVEL_FULL 450 /* 4.50V */ |
34 | #define BATTERY_CAPACITY_MIN 1000 | ||
35 | #define BATTERY_CAPACITY_MAX 2000 /* max. capacity selectable in settings */ | ||
32 | #else /* Recorder, NiMH */ | 36 | #else /* Recorder, NiMH */ |
33 | #define BATTERY_LEVEL_SHUTDOWN 450 /* 4.50V */ | 37 | #define BATTERY_LEVEL_SHUTDOWN 450 /* 4.50V */ |
34 | #define BATTERY_LEVEL_EMPTY 465 /* 4.65V */ | 38 | #define BATTERY_LEVEL_EMPTY 465 /* 4.65V */ |
35 | #define BATTERY_LEVEL_DANGEROUS 475 /* 4.75V */ | 39 | #define BATTERY_LEVEL_DANGEROUS 475 /* 4.75V */ |
36 | #define BATTERY_LEVEL_FULL 585 /* 5.85V */ | 40 | #define BATTERY_LEVEL_FULL 585 /* 5.85V */ |
41 | #define BATTERY_CAPACITY_MIN 1500 | ||
42 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable in settings */ | ||
37 | #endif | 43 | #endif |
38 | 44 | ||
39 | #define BATTERY_RANGE (BATTERY_LEVEL_FULL - BATTERY_LEVEL_EMPTY) | 45 | #define BATTERY_RANGE (BATTERY_LEVEL_FULL - BATTERY_LEVEL_EMPTY) |
40 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity that can be selected in settings menu, min. is always 1500 */ | ||
41 | 46 | ||
42 | #define POWER_HISTORY_LEN 2*60 /* 2 hours of samples, one per minute */ | 47 | #define POWER_HISTORY_LEN 2*60 /* 2 hours of samples, one per minute */ |
43 | #define POWER_AVG_N 4 /* how many samples to take for each measurement */ | 48 | #define POWER_AVG_N 4 /* how many samples to take for each measurement */ |