diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-01-30 16:25:46 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-01-30 16:25:46 +0000 |
commit | 91846a1a8d94dc8c7540efe3bbc8216f6ded7cb2 (patch) | |
tree | 8a8f0c328495e0631e568c1bdbe7c151e2590190 /firmware/export | |
parent | 8a77317e9c7c708153d8547bfccc3b4ef2324e3c (diff) | |
download | rockbox-91846a1a8d94dc8c7540efe3bbc8216f6ded7cb2.tar.gz rockbox-91846a1a8d94dc8c7540efe3bbc8216f6ded7cb2.zip |
New Ondio feature: Battery type setting, for correct battery level display.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5717 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/config-ondiofm.h | 2 | ||||
-rw-r--r-- | firmware/export/config-ondiosp.h | 2 | ||||
-rw-r--r-- | firmware/export/config.h | 6 | ||||
-rw-r--r-- | firmware/export/powermgmt.h | 8 |
4 files changed, 11 insertions, 7 deletions
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h index 99d4c483ea..79e7adbe58 100644 --- a/firmware/export/config-ondiofm.h +++ b/firmware/export/config-ondiofm.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #define CONFIG_I2C I2C_ONDIO | 26 | #define CONFIG_I2C I2C_ONDIO |
27 | 27 | ||
28 | /* Type of mobile power */ | 28 | /* Type of mobile power */ |
29 | #define CONFIG_BATTERY BATT_3AAA_ALKALINE | 29 | #define CONFIG_BATTERY BATT_3AAA |
30 | 30 | ||
31 | /* Battery scale factor (average from 3 Ondios) */ | 31 | /* Battery scale factor (average from 3 Ondios) */ |
32 | #define BATTERY_SCALE_FACTOR 4735 | 32 | #define BATTERY_SCALE_FACTOR 4735 |
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index 41bc83bf60..bda078a792 100644 --- a/firmware/export/config-ondiosp.h +++ b/firmware/export/config-ondiosp.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #define CPU_FREQ 12000000 | 20 | #define CPU_FREQ 12000000 |
21 | 21 | ||
22 | /* Type of mobile power */ | 22 | /* Type of mobile power */ |
23 | #define CONFIG_BATTERY BATT_3AAA_ALKALINE | 23 | #define CONFIG_BATTERY BATT_3AAA |
24 | 24 | ||
25 | /* Battery scale factor (average from 3 Ondios) */ | 25 | /* Battery scale factor (average from 3 Ondios) */ |
26 | #define BATTERY_SCALE_FACTOR 4735 | 26 | #define BATTERY_SCALE_FACTOR 4735 |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 4a55fbc622..64694af794 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -45,9 +45,9 @@ | |||
45 | #define GMINI100_PAD 4 | 45 | #define GMINI100_PAD 4 |
46 | 46 | ||
47 | /* CONFIG_BATTERY */ | 47 | /* CONFIG_BATTERY */ |
48 | #define BATT_LIION2200 2200 /* FM/V2 recorder type */ | 48 | #define BATT_LIION2200 2200 /* FM/V2 recorder type */ |
49 | #define BATT_4AA_NIMH 1500 | 49 | #define BATT_4AA_NIMH 1500 |
50 | #define BATT_3AAA_ALKALINE 1000 | 50 | #define BATT_3AAA 1000 /* Ondio */ |
51 | 51 | ||
52 | /* CONFIG_LCD */ | 52 | /* CONFIG_LCD */ |
53 | #define LCD_GMINI100 0 | 53 | #define LCD_GMINI100 0 |
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h index 2847156f46..ce006e9145 100644 --- a/firmware/export/powermgmt.h +++ b/firmware/export/powermgmt.h | |||
@@ -26,13 +26,15 @@ | |||
26 | #define BATTERY_LEVEL_FULL 400 /* 4.00V */ | 26 | #define BATTERY_LEVEL_FULL 400 /* 4.00V */ |
27 | #define BATTERY_CAPACITY_MIN 2200 | 27 | #define BATTERY_CAPACITY_MIN 2200 |
28 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable in settings */ | 28 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable in settings */ |
29 | #elif CONFIG_BATTERY == BATT_3AAA_ALKALINE /* Ondio, Alkalines */ | 29 | #define BATTERY_TYPES_COUNT 1 |
30 | #elif CONFIG_BATTERY == BATT_3AAA /* Ondio */ | ||
30 | #define BATTERY_LEVEL_SHUTDOWN 260 /* 2.60V */ | 31 | #define BATTERY_LEVEL_SHUTDOWN 260 /* 2.60V */ |
31 | #define BATTERY_LEVEL_EMPTY 270 /* 2.70V */ | 32 | #define BATTERY_LEVEL_EMPTY 270 /* 2.70V */ |
32 | #define BATTERY_LEVEL_DANGEROUS 280 /* 2.80V */ | 33 | #define BATTERY_LEVEL_DANGEROUS 280 /* 2.80V */ |
33 | #define BATTERY_LEVEL_FULL 450 /* 4.50V */ | 34 | #define BATTERY_LEVEL_FULL 475 /* 4.75V */ |
34 | #define BATTERY_CAPACITY_MIN 500 | 35 | #define BATTERY_CAPACITY_MIN 500 |
35 | #define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable in settings */ | 36 | #define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable in settings */ |
37 | #define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */ | ||
36 | #else /* Recorder, NiMH */ | 38 | #else /* Recorder, NiMH */ |
37 | #define BATTERY_LEVEL_SHUTDOWN 450 /* 4.50V */ | 39 | #define BATTERY_LEVEL_SHUTDOWN 450 /* 4.50V */ |
38 | #define BATTERY_LEVEL_EMPTY 465 /* 4.65V */ | 40 | #define BATTERY_LEVEL_EMPTY 465 /* 4.65V */ |
@@ -40,6 +42,7 @@ | |||
40 | #define BATTERY_LEVEL_FULL 585 /* 5.85V */ | 42 | #define BATTERY_LEVEL_FULL 585 /* 5.85V */ |
41 | #define BATTERY_CAPACITY_MIN 1500 | 43 | #define BATTERY_CAPACITY_MIN 1500 |
42 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable in settings */ | 44 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable in settings */ |
45 | #define BATTERY_TYPES_COUNT 1 | ||
43 | #endif | 46 | #endif |
44 | 47 | ||
45 | #define BATTERY_RANGE (BATTERY_LEVEL_FULL - BATTERY_LEVEL_EMPTY) | 48 | #define BATTERY_RANGE (BATTERY_LEVEL_FULL - BATTERY_LEVEL_EMPTY) |
@@ -111,6 +114,7 @@ bool battery_level_safe(void); | |||
111 | 114 | ||
112 | void set_poweroff_timeout(int timeout); | 115 | void set_poweroff_timeout(int timeout); |
113 | void set_battery_capacity(int capacity); /* set local battery capacity value */ | 116 | void set_battery_capacity(int capacity); /* set local battery capacity value */ |
117 | void set_battery_type(int type); /* set local battery type */ | ||
114 | 118 | ||
115 | void set_sleep_timer(int seconds); | 119 | void set_sleep_timer(int seconds); |
116 | int get_sleep_timer(void); | 120 | int get_sleep_timer(void); |