diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-08-17 06:45:18 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-08-17 06:45:18 +0000 |
commit | 0fac492c3da8b46ad1cf5a668e5d851c63443a94 (patch) | |
tree | 95fb6637601a4b3c730f4aec1d2e7e7ab78e208b /firmware/export | |
parent | 12706e4b1d4ce65df441dcf6e2b160657ea3fa38 (diff) | |
download | rockbox-0fac492c3da8b46ad1cf5a668e5d851c63443a94.tar.gz rockbox-0fac492c3da8b46ad1cf5a668e5d851c63443a94.zip |
First step of powermanagement rework: * Move target specific stuff into target tree, starting with battery voltage tables and voltage reading. (This revealed some incorrect percent_to_voltage_charging mappings). * Voltage reading on 1st gen ipods is now correct. * Clean up obsolete config #defines.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14375 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
27 files changed, 32 insertions, 109 deletions
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h index 17f06b5cea..5a23b276eb 100644 --- a/firmware/export/config-e200.h +++ b/firmware/export/config-e200.h | |||
@@ -106,14 +106,11 @@ | |||
106 | 106 | ||
107 | #define HAVE_MULTIVOLUME | 107 | #define HAVE_MULTIVOLUME |
108 | 108 | ||
109 | /* Type of mobile power */ | ||
110 | #define CONFIG_BATTERY BATT_LIION750 | ||
111 | #define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */ | 109 | #define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */ |
112 | #define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */ | 110 | #define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */ |
113 | #define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */ | 111 | #define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */ |
114 | #define BATTERY_CAPACITY_INC 0 /* capacity increment */ | 112 | #define BATTERY_CAPACITY_INC 0 /* capacity increment */ |
115 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 113 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
116 | #define BATTERY_SCALE_FACTOR 5005 /* ADC should read 0x3ff=5.12V */ | ||
117 | 114 | ||
118 | /* Hardware controlled charging? FIXME */ | 115 | /* Hardware controlled charging? FIXME */ |
119 | #define CONFIG_CHARGING CHARGING_SIMPLE | 116 | #define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index a41c69a7bf..b237bd5804 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h | |||
@@ -60,15 +60,11 @@ | |||
60 | 60 | ||
61 | #define CONFIG_I2C I2C_PLAYREC | 61 | #define CONFIG_I2C I2C_PLAYREC |
62 | 62 | ||
63 | /* Type of mobile power */ | ||
64 | #define CONFIG_BATTERY BATT_LIION2200 | ||
65 | #define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */ | 63 | #define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */ |
66 | #define BATTERY_CAPACITY_MIN 2200 /* min. capacity selectable */ | 64 | #define BATTERY_CAPACITY_MIN 2200 /* min. capacity selectable */ |
67 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ | 65 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ |
68 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 66 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
69 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 67 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
70 | /* Battery scale factor (guessed, seems to be 1,25 * value from recorder) */ | ||
71 | #define BATTERY_SCALE_FACTOR 8081 | ||
72 | 68 | ||
73 | /* Hardware controlled charging with monitoring */ | 69 | /* Hardware controlled charging with monitoring */ |
74 | #define CONFIG_CHARGING CHARGING_MONITOR | 70 | #define CONFIG_CHARGING CHARGING_MONITOR |
diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h index 319ad4e916..ba6b714a17 100644 --- a/firmware/export/config-gigabeat.h +++ b/firmware/export/config-gigabeat.h | |||
@@ -79,15 +79,11 @@ | |||
79 | 79 | ||
80 | #define HAVE_HEADPHONE_DETECTION | 80 | #define HAVE_HEADPHONE_DETECTION |
81 | 81 | ||
82 | /* Type of mobile power - check this out */ | ||
83 | #define CONFIG_BATTERY BATT_LIION830 /* could change this later */ | ||
84 | #define BATTERY_CAPACITY_DEFAULT 2000 /* default battery capacity */ | 82 | #define BATTERY_CAPACITY_DEFAULT 2000 /* default battery capacity */ |
85 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ | 83 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ |
86 | #define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */ | 84 | #define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */ |
87 | #define BATTERY_CAPACITY_INC 25 /* capacity increment */ | 85 | #define BATTERY_CAPACITY_INC 25 /* capacity increment */ |
88 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 86 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
89 | /* ADC[0] is (530) at discharge and 625 at full charge */ | ||
90 | #define BATTERY_SCALE_FACTOR 6450 | ||
91 | 87 | ||
92 | /* Hardware controlled charging with monitoring */ | 88 | /* Hardware controlled charging with monitoring */ |
93 | #define CONFIG_CHARGING CHARGING_MONITOR | 89 | #define CONFIG_CHARGING CHARGING_MONITOR |
diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h index 502b5b106e..b54397f46c 100644 --- a/firmware/export/config-h10.h +++ b/firmware/export/config-h10.h | |||
@@ -93,14 +93,11 @@ | |||
93 | 93 | ||
94 | #define AB_REPEAT_ENABLE 1 | 94 | #define AB_REPEAT_ENABLE 1 |
95 | 95 | ||
96 | /* Type of mobile power */ | ||
97 | #define CONFIG_BATTERY BATT_LPCS355385 | ||
98 | #define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity */ | 96 | #define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity */ |
99 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ | 97 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ |
100 | #define BATTERY_CAPACITY_MAX 1600 /* max. capacity selectable */ | 98 | #define BATTERY_CAPACITY_MAX 1600 /* max. capacity selectable */ |
101 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ | 99 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ |
102 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 100 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
103 | #define BATTERY_SCALE_FACTOR 4688 | ||
104 | 101 | ||
105 | /* Hardware controlled charging */ | 102 | /* Hardware controlled charging */ |
106 | #define CONFIG_CHARGING CHARGING_SIMPLE | 103 | #define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 3d6f217ebb..c661e1df14 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h | |||
@@ -91,14 +91,11 @@ | |||
91 | 91 | ||
92 | #define HAVE_AGC | 92 | #define HAVE_AGC |
93 | 93 | ||
94 | /* Type of mobile power */ | ||
95 | #define CONFIG_BATTERY BATT_LIPOL1300 | ||
96 | #define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */ | 94 | #define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */ |
97 | #define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */ | 95 | #define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */ |
98 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ | 96 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ |
99 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 97 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
100 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 98 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
101 | #define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */ | ||
102 | 99 | ||
103 | /* Hardware controlled charging */ | 100 | /* Hardware controlled charging */ |
104 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 101 | //#define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h index 254f59fa35..d45b6e3064 100644 --- a/firmware/export/config-h10_5gb.h +++ b/firmware/export/config-h10_5gb.h | |||
@@ -79,14 +79,11 @@ | |||
79 | 79 | ||
80 | #define AB_REPEAT_ENABLE 1 | 80 | #define AB_REPEAT_ENABLE 1 |
81 | 81 | ||
82 | /* Type of mobile power */ | ||
83 | #define CONFIG_BATTERY BATT_BP009 | ||
84 | #define BATTERY_CAPACITY_DEFAULT 820 /* default battery capacity */ | 82 | #define BATTERY_CAPACITY_DEFAULT 820 /* default battery capacity */ |
85 | #define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */ | 83 | #define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */ |
86 | #define BATTERY_CAPACITY_MAX 900 /* max. capacity selectable */ | 84 | #define BATTERY_CAPACITY_MAX 900 /* max. capacity selectable */ |
87 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ | 85 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ |
88 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 86 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
89 | #define BATTERY_SCALE_FACTOR 4688 | ||
90 | 87 | ||
91 | /* Hardware controlled charging */ | 88 | /* Hardware controlled charging */ |
92 | #define CONFIG_CHARGING CHARGING_SIMPLE | 89 | #define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index bf13f3e1d7..6fc9aa2406 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h | |||
@@ -91,13 +91,11 @@ | |||
91 | 91 | ||
92 | #define HAVE_AGC | 92 | #define HAVE_AGC |
93 | 93 | ||
94 | #define CONFIG_BATTERY BATT_LIPOL1300 | ||
95 | #define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */ | 94 | #define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */ |
96 | #define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */ | 95 | #define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */ |
97 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ | 96 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ |
98 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 97 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
99 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 98 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
100 | #define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */ | ||
101 | 99 | ||
102 | /* Hardware controlled charging */ | 100 | /* Hardware controlled charging */ |
103 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 101 | //#define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h index 91c175fc7d..483582080e 100644 --- a/firmware/export/config-h300.h +++ b/firmware/export/config-h300.h | |||
@@ -88,14 +88,11 @@ | |||
88 | 88 | ||
89 | #define HAVE_AGC | 89 | #define HAVE_AGC |
90 | 90 | ||
91 | /* Type of mobile power */ | ||
92 | #define CONFIG_BATTERY BATT_LIPOL1300 | ||
93 | #define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */ | 91 | #define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */ |
94 | #define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */ | 92 | #define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */ |
95 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ | 93 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ |
96 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 94 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
97 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 95 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
98 | #define BATTERY_SCALE_FACTOR 23437 /* FIX: this value is picked at random */ | ||
99 | 96 | ||
100 | /* Hardware controlled charging with monitoring */ | 97 | /* Hardware controlled charging with monitoring */ |
101 | #define CONFIG_CHARGING CHARGING_MONITOR | 98 | #define CONFIG_CHARGING CHARGING_MONITOR |
diff --git a/firmware/export/config-iaudiom5.h b/firmware/export/config-iaudiom5.h index 4ab8e2c0dc..3e98f4e748 100644 --- a/firmware/export/config-iaudiom5.h +++ b/firmware/export/config-iaudiom5.h | |||
@@ -84,15 +84,11 @@ | |||
84 | /* TLV320 has no tone controls, so we use the software ones */ | 84 | /* TLV320 has no tone controls, so we use the software ones */ |
85 | #define HAVE_SW_TONE_CONTROLS | 85 | #define HAVE_SW_TONE_CONTROLS |
86 | 86 | ||
87 | /* Type of mobile power */ | ||
88 | #define X5_BATT_CONFIG 2 | ||
89 | #define CONFIG_BATTERY BATT_IAUDIO_X5M5 | ||
90 | #define BATTERY_CAPACITY_DEFAULT 950 /* default battery capacity */ | 87 | #define BATTERY_CAPACITY_DEFAULT 950 /* default battery capacity */ |
91 | #define BATTERY_CAPACITY_MIN 950 /* min. capacity selectable */ | 88 | #define BATTERY_CAPACITY_MIN 950 /* min. capacity selectable */ |
92 | #define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */ | 89 | #define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */ |
93 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 90 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
94 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 91 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
95 | #define BATTERY_SCALE_FACTOR 5859 /* (420703125 + 35900) / 71800 */ | ||
96 | 92 | ||
97 | /* Hardware controlled charging? FIXME */ | 93 | /* Hardware controlled charging? FIXME */ |
98 | #define CONFIG_CHARGING CHARGING_SIMPLE | 94 | #define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index c02b2a78f4..c78137c721 100644 --- a/firmware/export/config-iaudiox5.h +++ b/firmware/export/config-iaudiox5.h | |||
@@ -98,15 +98,11 @@ | |||
98 | /* TLV320 has no tone controls, so we use the software ones */ | 98 | /* TLV320 has no tone controls, so we use the software ones */ |
99 | #define HAVE_SW_TONE_CONTROLS | 99 | #define HAVE_SW_TONE_CONTROLS |
100 | 100 | ||
101 | /* Type of mobile power */ | ||
102 | #define X5_BATT_CONFIG 2 | ||
103 | #define CONFIG_BATTERY BATT_IAUDIO_X5M5 | ||
104 | #define BATTERY_CAPACITY_DEFAULT 950 /* default battery capacity */ | 101 | #define BATTERY_CAPACITY_DEFAULT 950 /* default battery capacity */ |
105 | #define BATTERY_CAPACITY_MIN 950 /* min. capacity selectable */ | 102 | #define BATTERY_CAPACITY_MIN 950 /* min. capacity selectable */ |
106 | #define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */ | 103 | #define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */ |
107 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 104 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
108 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 105 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
109 | #define BATTERY_SCALE_FACTOR 5859 /* (420703125 + 35900) / 71800 */ | ||
110 | 106 | ||
111 | /* Hardware controlled charging? FIXME */ | 107 | /* Hardware controlled charging? FIXME */ |
112 | #define CONFIG_CHARGING CHARGING_SIMPLE | 108 | #define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h index 65915df30e..20421ea5be 100644 --- a/firmware/export/config-ifp7xx.h +++ b/firmware/export/config-ifp7xx.h | |||
@@ -60,14 +60,14 @@ | |||
60 | /* define this if you have a flash memory storage */ | 60 | /* define this if you have a flash memory storage */ |
61 | #define HAVE_FLASH_STORAGE | 61 | #define HAVE_FLASH_STORAGE |
62 | 62 | ||
63 | /* Type of mobile power */ | ||
64 | #define CONFIG_BATTERY BATT_1AA | ||
65 | #define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ | 63 | #define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ |
66 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ | 64 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ |
67 | #define BATTERY_CAPACITY_MAX 2800 /* max. capacity selectable */ | 65 | #define BATTERY_CAPACITY_MAX 2800 /* max. capacity selectable */ |
68 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 66 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
69 | #define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */ | 67 | #define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */ |
70 | #define BATTERY_SCALE_FACTOR 3000 /* TODO: only roughly correct */ | 68 | |
69 | /* define this if the unit should not shut down on low battery. */ | ||
70 | #define NO_LOW_BATTERY_SHUTDOWN | ||
71 | 71 | ||
72 | #ifndef SIMULATOR | 72 | #ifndef SIMULATOR |
73 | 73 | ||
diff --git a/firmware/export/config-ipod1g2g.h b/firmware/export/config-ipod1g2g.h index ff3e7b5636..d51a7437ec 100644 --- a/firmware/export/config-ipod1g2g.h +++ b/firmware/export/config-ipod1g2g.h | |||
@@ -69,14 +69,11 @@ | |||
69 | /* Define this if you can detect headphones */ | 69 | /* Define this if you can detect headphones */ |
70 | #define HAVE_HEADPHONE_DETECTION | 70 | #define HAVE_HEADPHONE_DETECTION |
71 | 71 | ||
72 | /* Type of mobile power */ | ||
73 | #define CONFIG_BATTERY BATT_LIPOL1300 | ||
74 | #define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */ | 72 | #define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */ |
75 | #define BATTERY_CAPACITY_MIN 1200 /* min. capacity selectable */ | 73 | #define BATTERY_CAPACITY_MIN 1200 /* min. capacity selectable */ |
76 | #define BATTERY_CAPACITY_MAX 1900 /* max. capacity selectable */ | 74 | #define BATTERY_CAPACITY_MAX 1900 /* max. capacity selectable */ |
77 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 75 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
78 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 76 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
79 | #define BATTERY_SCALE_FACTOR 25882 | ||
80 | 77 | ||
81 | /* Hardware controlled charging? FIXME */ | 78 | /* Hardware controlled charging? FIXME */ |
82 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 79 | //#define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h index 64aa14941b..e4be8c7d6e 100644 --- a/firmware/export/config-ipod3g.h +++ b/firmware/export/config-ipod3g.h | |||
@@ -72,14 +72,11 @@ | |||
72 | /* Define this if you can detect headphones */ | 72 | /* Define this if you can detect headphones */ |
73 | #define HAVE_HEADPHONE_DETECTION | 73 | #define HAVE_HEADPHONE_DETECTION |
74 | 74 | ||
75 | /* Type of mobile power */ | ||
76 | #define CONFIG_BATTERY BATT_LIPOL1300 | ||
77 | #define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */ | 75 | #define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */ |
78 | #define BATTERY_CAPACITY_MIN 630 /* min. capacity selectable */ | 76 | #define BATTERY_CAPACITY_MIN 630 /* min. capacity selectable */ |
79 | #define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ | 77 | #define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ |
80 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ | 78 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ |
81 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 79 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
82 | #define BATTERY_SCALE_FACTOR 5865 | ||
83 | 80 | ||
84 | /* Hardware controlled charging? FIXME */ | 81 | /* Hardware controlled charging? FIXME */ |
85 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 82 | //#define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h index 46c1e53235..84c38f8506 100644 --- a/firmware/export/config-ipod4g.h +++ b/firmware/export/config-ipod4g.h | |||
@@ -82,14 +82,11 @@ | |||
82 | /* Define this if you can detect headphones */ | 82 | /* Define this if you can detect headphones */ |
83 | #define HAVE_HEADPHONE_DETECTION | 83 | #define HAVE_HEADPHONE_DETECTION |
84 | 84 | ||
85 | /* Type of mobile power */ | ||
86 | #define CONFIG_BATTERY BATT_LIPOL1300 | ||
87 | #define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */ | 85 | #define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */ |
88 | #define BATTERY_CAPACITY_MIN 630 /* min. capacity selectable */ | 86 | #define BATTERY_CAPACITY_MIN 630 /* min. capacity selectable */ |
89 | #define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ | 87 | #define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ |
90 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ | 88 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ |
91 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 89 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
92 | #define BATTERY_SCALE_FACTOR 5865 | ||
93 | 90 | ||
94 | /* Hardware controlled charging? FIXME */ | 91 | /* Hardware controlled charging? FIXME */ |
95 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 92 | //#define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h index 586d6727bc..c1098c71fe 100644 --- a/firmware/export/config-ipodcolor.h +++ b/firmware/export/config-ipodcolor.h | |||
@@ -73,14 +73,11 @@ | |||
73 | /* Define this if you can detect headphones */ | 73 | /* Define this if you can detect headphones */ |
74 | #define HAVE_HEADPHONE_DETECTION | 74 | #define HAVE_HEADPHONE_DETECTION |
75 | 75 | ||
76 | /* Type of mobile power */ | ||
77 | #define CONFIG_BATTERY BATT_LIPOL1300 | ||
78 | #define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity */ | 76 | #define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity */ |
79 | #define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */ | 77 | #define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */ |
80 | #define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ | 78 | #define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ |
81 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ | 79 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ |
82 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 80 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
83 | #define BATTERY_SCALE_FACTOR 5865 | ||
84 | 81 | ||
85 | /* Hardware controlled charging? FIXME */ | 82 | /* Hardware controlled charging? FIXME */ |
86 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 83 | //#define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h index 3b215a43c5..54d0e2c230 100644 --- a/firmware/export/config-ipodmini.h +++ b/firmware/export/config-ipodmini.h | |||
@@ -78,14 +78,11 @@ | |||
78 | /* Define this if you can detect headphones */ | 78 | /* Define this if you can detect headphones */ |
79 | #define HAVE_HEADPHONE_DETECTION | 79 | #define HAVE_HEADPHONE_DETECTION |
80 | 80 | ||
81 | /* Type of mobile power */ | ||
82 | #define CONFIG_BATTERY BATT_LIPOL1300 | ||
83 | #define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity */ | 81 | #define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity */ |
84 | #define BATTERY_CAPACITY_MIN 400 /* min. capacity selectable */ | 82 | #define BATTERY_CAPACITY_MIN 400 /* min. capacity selectable */ |
85 | #define BATTERY_CAPACITY_MAX 800 /* max. capacity selectable */ | 83 | #define BATTERY_CAPACITY_MAX 800 /* max. capacity selectable */ |
86 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ | 84 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ |
87 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 85 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
88 | #define BATTERY_SCALE_FACTOR 5865 | ||
89 | 86 | ||
90 | /* Hardware controlled charging? FIXME */ | 87 | /* Hardware controlled charging? FIXME */ |
91 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 88 | //#define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h index 76c64f47d4..5a851fffee 100644 --- a/firmware/export/config-ipodmini2g.h +++ b/firmware/export/config-ipodmini2g.h | |||
@@ -78,14 +78,11 @@ | |||
78 | /* Define this if you can detect headphones */ | 78 | /* Define this if you can detect headphones */ |
79 | #define HAVE_HEADPHONE_DETECTION | 79 | #define HAVE_HEADPHONE_DETECTION |
80 | 80 | ||
81 | /* Type of mobile power */ | ||
82 | #define CONFIG_BATTERY BATT_LIPOL1300 | ||
83 | #define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity */ | 81 | #define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity */ |
84 | #define BATTERY_CAPACITY_MIN 400 /* min. capacity selectable */ | 82 | #define BATTERY_CAPACITY_MIN 400 /* min. capacity selectable */ |
85 | #define BATTERY_CAPACITY_MAX 800 /* max. capacity selectable */ | 83 | #define BATTERY_CAPACITY_MAX 800 /* max. capacity selectable */ |
86 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 84 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
87 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 85 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
88 | #define BATTERY_SCALE_FACTOR 5865 | ||
89 | 86 | ||
90 | /* Hardware controlled charging? FIXME */ | 87 | /* Hardware controlled charging? FIXME */ |
91 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 88 | //#define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h index a2f9e3249b..d3c229593f 100644 --- a/firmware/export/config-ipodnano.h +++ b/firmware/export/config-ipodnano.h | |||
@@ -79,8 +79,6 @@ | |||
79 | /* define this if you have a flash memory storage */ | 79 | /* define this if you have a flash memory storage */ |
80 | #define HAVE_FLASH_STORAGE | 80 | #define HAVE_FLASH_STORAGE |
81 | 81 | ||
82 | /* Type of mobile power */ | ||
83 | #define CONFIG_BATTERY BATT_LIION300 | ||
84 | #define BATTERY_CAPACITY_DEFAULT 300 /* default battery capacity */ | 82 | #define BATTERY_CAPACITY_DEFAULT 300 /* default battery capacity */ |
85 | #define BATTERY_CAPACITY_MIN 200 /* min. capacity selectable */ | 83 | #define BATTERY_CAPACITY_MIN 200 /* min. capacity selectable */ |
86 | #define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */ | 84 | #define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */ |
@@ -101,8 +99,6 @@ | |||
101 | /* Define this if you want to use the PP5020 i2c interface */ | 99 | /* Define this if you want to use the PP5020 i2c interface */ |
102 | #define CONFIG_I2C I2C_PP5020 | 100 | #define CONFIG_I2C I2C_PP5020 |
103 | 101 | ||
104 | #define BATTERY_SCALE_FACTOR 5840 | ||
105 | |||
106 | /* define this if the hardware can be powered off while charging */ | 102 | /* define this if the hardware can be powered off while charging */ |
107 | //#define HAVE_POWEROFF_WHILE_CHARGING | 103 | //#define HAVE_POWEROFF_WHILE_CHARGING |
108 | 104 | ||
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h index 0f2da5360a..b792f6f5dc 100644 --- a/firmware/export/config-ipodvideo.h +++ b/firmware/export/config-ipodvideo.h | |||
@@ -8,9 +8,6 @@ | |||
8 | /* For Rolo and boot loader */ | 8 | /* For Rolo and boot loader */ |
9 | #define MODEL_NUMBER 5 | 9 | #define MODEL_NUMBER 5 |
10 | 10 | ||
11 | /* For battery type (30GB by default, undefine here to use 60/80GB model) */ | ||
12 | #define CONFIG_BATTERY_IPOD_VIDEO_30GB | ||
13 | |||
14 | /* define this if you have recording possibility */ | 11 | /* define this if you have recording possibility */ |
15 | #define HAVE_RECORDING | 12 | #define HAVE_RECORDING |
16 | 13 | ||
@@ -81,22 +78,16 @@ | |||
81 | 78 | ||
82 | /* Type of mobile power */ | 79 | /* Type of mobile power */ |
83 | #if (MEM==32) /* this is the 30GB-model */ | 80 | #if (MEM==32) /* this is the 30GB-model */ |
84 | # define CONFIG_BATTERY BATT_LIION400 | 81 | # define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity for the 30GB model */ |
85 | # define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity for the 30GB model */ | 82 | # define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */ |
86 | # define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */ | 83 | # define BATTERY_CAPACITY_MAX 800 /* max. capacity selectable */ |
87 | # define BATTERY_CAPACITY_MAX 800 /* max. capacity selectable */ | ||
88 | # define BATTERY_CAPACITY_INC 50 /* capacity increment */ | ||
89 | # define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
90 | # define BATTERY_SCALE_FACTOR 5865 | ||
91 | #else /* these are the 60/80GB-models */ | 84 | #else /* these are the 60/80GB-models */ |
92 | # define CONFIG_BATTERY BATT_LIION400 /* FIXME: we assume to have same discharge behaviour as 30GB iPOD */ | 85 | # define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity for the 60/80GB model */ |
93 | # define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity for the 60/80GB model */ | 86 | # define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ |
94 | # define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ | 87 | # define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ |
95 | # define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ | ||
96 | # define BATTERY_CAPACITY_INC 50 /* capacity increment */ | ||
97 | # define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
98 | # define BATTERY_SCALE_FACTOR 5865 | ||
99 | #endif | 88 | #endif |
89 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | ||
90 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
100 | 91 | ||
101 | /* Hardware controlled charging with monitoring */ | 92 | /* Hardware controlled charging with monitoring */ |
102 | #define CONFIG_CHARGING CHARGING_MONITOR | 93 | #define CONFIG_CHARGING CHARGING_MONITOR |
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h index 335ce855fc..1a288c5c87 100644 --- a/firmware/export/config-ondiofm.h +++ b/firmware/export/config-ondiofm.h | |||
@@ -52,14 +52,14 @@ | |||
52 | /* define this if more than one device/partition can be used */ | 52 | /* define this if more than one device/partition can be used */ |
53 | #define HAVE_MULTIVOLUME | 53 | #define HAVE_MULTIVOLUME |
54 | 54 | ||
55 | /* Type of mobile power */ | ||
56 | #define CONFIG_BATTERY BATT_3AAA | ||
57 | #define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ | 55 | #define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ |
58 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ | 56 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ |
59 | #define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable */ | 57 | #define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable */ |
60 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 58 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
61 | #define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */ | 59 | #define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */ |
62 | #define BATTERY_SCALE_FACTOR 4735 /* average from 3 Ondios */ | 60 | |
61 | /* define this if the unit should not shut down on low battery. */ | ||
62 | #define NO_LOW_BATTERY_SHUTDOWN | ||
63 | 63 | ||
64 | /* define this if the unit can be powered or charged via USB */ | 64 | /* define this if the unit can be powered or charged via USB */ |
65 | #define HAVE_USB_POWER | 65 | #define HAVE_USB_POWER |
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index 0ceb72e936..9d3dd729f2 100644 --- a/firmware/export/config-ondiosp.h +++ b/firmware/export/config-ondiosp.h | |||
@@ -41,14 +41,14 @@ | |||
41 | /* define this if more than one device/partition can be used */ | 41 | /* define this if more than one device/partition can be used */ |
42 | #define HAVE_MULTIVOLUME | 42 | #define HAVE_MULTIVOLUME |
43 | 43 | ||
44 | /* Type of mobile power */ | ||
45 | #define CONFIG_BATTERY BATT_3AAA | ||
46 | #define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ | 44 | #define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ |
47 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ | 45 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ |
48 | #define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable */ | 46 | #define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable */ |
49 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 47 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
50 | #define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */ | 48 | #define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */ |
51 | #define BATTERY_SCALE_FACTOR 4735 /* average from 3 Ondios */ | 49 | |
50 | /* define this if the unit should not shut down on low battery. */ | ||
51 | #define NO_LOW_BATTERY_SHUTDOWN | ||
52 | 52 | ||
53 | /* define this if the unit can be powered or charged via USB */ | 53 | /* define this if the unit can be powered or charged via USB */ |
54 | #define HAVE_USB_POWER | 54 | #define HAVE_USB_POWER |
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h index bd89b0bb2e..723b852d3d 100644 --- a/firmware/export/config-player.h +++ b/firmware/export/config-player.h | |||
@@ -27,14 +27,14 @@ | |||
27 | /* Define this for LCD backlight available */ | 27 | /* Define this for LCD backlight available */ |
28 | #define HAVE_BACKLIGHT | 28 | #define HAVE_BACKLIGHT |
29 | 29 | ||
30 | /* Type of mobile power */ | ||
31 | #define CONFIG_BATTERY BATT_4AA_NIMH | ||
32 | #define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */ | 30 | #define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */ |
33 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ | 31 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ |
34 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ | 32 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ |
35 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 33 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
36 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 34 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
37 | #define BATTERY_SCALE_FACTOR 6546 | 35 | |
36 | /* define this if the unit should not shut down on low battery. */ | ||
37 | #define NO_LOW_BATTERY_SHUTDOWN | ||
38 | 38 | ||
39 | /* Hardware controlled charging */ | 39 | /* Hardware controlled charging */ |
40 | #define CONFIG_CHARGING CHARGING_SIMPLE | 40 | #define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h index 4569c8bfd0..bb57ba5666 100644 --- a/firmware/export/config-recorder.h +++ b/firmware/export/config-recorder.h | |||
@@ -51,14 +51,14 @@ | |||
51 | 51 | ||
52 | #define CONFIG_I2C I2C_PLAYREC | 52 | #define CONFIG_I2C I2C_PLAYREC |
53 | 53 | ||
54 | /* Type of mobile power */ | ||
55 | #define CONFIG_BATTERY BATT_4AA_NIMH | ||
56 | #define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */ | 54 | #define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */ |
57 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ | 55 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ |
58 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ | 56 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ |
59 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 57 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
60 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 58 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
61 | #define BATTERY_SCALE_FACTOR 6465 | 59 | |
60 | /* define this if the unit should not shut down on low battery. */ | ||
61 | #define NO_LOW_BATTERY_SHUTDOWN | ||
62 | 62 | ||
63 | /* Software controlled charging */ | 63 | /* Software controlled charging */ |
64 | #define CONFIG_CHARGING CHARGING_CONTROL | 64 | #define CONFIG_CHARGING CHARGING_CONTROL |
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h index d28595d154..f06aa92550 100644 --- a/firmware/export/config-recorderv2.h +++ b/firmware/export/config-recorderv2.h | |||
@@ -57,15 +57,11 @@ | |||
57 | 57 | ||
58 | #define CONFIG_I2C I2C_PLAYREC | 58 | #define CONFIG_I2C I2C_PLAYREC |
59 | 59 | ||
60 | /* Type of mobile power */ | ||
61 | #define CONFIG_BATTERY BATT_LIION2200 | ||
62 | #define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */ | 60 | #define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */ |
63 | #define BATTERY_CAPACITY_MIN 2200 /* min. capacity selectable */ | 61 | #define BATTERY_CAPACITY_MIN 2200 /* min. capacity selectable */ |
64 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ | 62 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ |
65 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 63 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ |
66 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 64 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
67 | /* Battery scale factor (guessed, seems to be 1,25 * value from recorder) */ | ||
68 | #define BATTERY_SCALE_FACTOR 8081 | ||
69 | 65 | ||
70 | /* Hardware controlled charging with monitoring */ | 66 | /* Hardware controlled charging with monitoring */ |
71 | #define CONFIG_CHARGING CHARGING_MONITOR | 67 | #define CONFIG_CHARGING CHARGING_MONITOR |
diff --git a/firmware/export/config-tpj1022.h b/firmware/export/config-tpj1022.h index be2da37412..067bb4f6f2 100644 --- a/firmware/export/config-tpj1022.h +++ b/firmware/export/config-tpj1022.h | |||
@@ -57,8 +57,6 @@ | |||
57 | /* Define this for LCD backlight available */ | 57 | /* Define this for LCD backlight available */ |
58 | #define HAVE_BACKLIGHT | 58 | #define HAVE_BACKLIGHT |
59 | 59 | ||
60 | /* Type of mobile power */ | ||
61 | #define CONFIG_BATTERY BATT_LPCS355385 | ||
62 | #define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity | 60 | #define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity |
63 | TODO: check this, probably different | 61 | TODO: check this, probably different |
64 | for different models too */ | 62 | for different models too */ |
@@ -66,7 +64,6 @@ | |||
66 | #define BATTERY_CAPACITY_MAX 1600 /* max. capacity selectable */ | 64 | #define BATTERY_CAPACITY_MAX 1600 /* max. capacity selectable */ |
67 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ | 65 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ |
68 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 66 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
69 | #define BATTERY_SCALE_FACTOR 5865 | ||
70 | 67 | ||
71 | /* Hardware controlled charging? FIXME */ | 68 | /* Hardware controlled charging? FIXME */ |
72 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 69 | //#define CONFIG_CHARGING CHARGING_SIMPLE |
diff --git a/firmware/export/config.h b/firmware/export/config.h index df5300c0b8..44583183b1 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -71,20 +71,6 @@ | |||
71 | #define H300_REMOTE 2 | 71 | #define H300_REMOTE 2 |
72 | #define X5_REMOTE 3 | 72 | #define X5_REMOTE 3 |
73 | 73 | ||
74 | /* CONFIG_BATTERY */ | ||
75 | #define BATT_LIION2200 2200 /* FM/V2 recorder type */ | ||
76 | #define BATT_4AA_NIMH 1500 | ||
77 | #define BATT_3AAA 1000 /* Ondio */ | ||
78 | #define BATT_IAUDIO_X5M5 950 | ||
79 | #define BATT_LIPOL1300 1300 /* the type used in iRiver h1x0 models */ | ||
80 | #define BATT_LPCS355385 1550 /* iriver h10 20Gb - SKC LPCS355385 */ | ||
81 | #define BATT_BP009 820 /* iriver H10 5/6Gb - iriver BP009 */ | ||
82 | #define BATT_LIION830 830 /* Toshiba Gigabeat Fxx and Xxx series MK11-2740 */ | ||
83 | #define BATT_LIION750 750 /* Sansa e200 LiIon 3,7V */ | ||
84 | #define BATT_LIION400 400 /* iPOD 5G/5.5G Video 30GB LiIon 400mAh */ | ||
85 | #define BATT_LIION300 300 /* iPOD nano LiIon 300mAh */ | ||
86 | #define BATT_1AA 333 /* iRiver iFP: Alkaline, NiHM */ | ||
87 | |||
88 | /* CONFIG_CHARGING */ | 74 | /* CONFIG_CHARGING */ |
89 | #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */ | 75 | #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */ |
90 | #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */ | 76 | #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */ |
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h index 89a0350bb7..858b5015ec 100644 --- a/firmware/export/powermgmt.h +++ b/firmware/export/powermgmt.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef _POWERMGMT_H_ | 19 | #ifndef _POWERMGMT_H_ |
20 | #define _POWERMGMT_H_ | 20 | #define _POWERMGMT_H_ |
21 | 21 | ||
22 | #include <stdbool.h> | ||
23 | |||
22 | #define POWER_HISTORY_LEN 2*60 /* 2 hours of samples, one per minute */ | 24 | #define POWER_HISTORY_LEN 2*60 /* 2 hours of samples, one per minute */ |
23 | 25 | ||
24 | #define CHARGE_END_SHORTD 6 /* stop when N minutes have passed with | 26 | #define CHARGE_END_SHORTD 6 /* stop when N minutes have passed with |
@@ -137,6 +139,12 @@ extern int trickle_sec; /* trickle charge: How many seconds per minute | |||
137 | #endif /* not HAVE_MMC */ | 139 | #endif /* not HAVE_MMC */ |
138 | 140 | ||
139 | extern unsigned short power_history[POWER_HISTORY_LEN]; | 141 | extern unsigned short power_history[POWER_HISTORY_LEN]; |
142 | extern const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT]; | ||
143 | extern const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT]; | ||
144 | extern const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11]; | ||
145 | #if CONFIG_CHARGING | ||
146 | extern const unsigned short percent_to_volt_charge[11]; | ||
147 | #endif | ||
140 | 148 | ||
141 | /* Start up power management thread */ | 149 | /* Start up power management thread */ |
142 | void powermgmt_init(void); | 150 | void powermgmt_init(void); |
@@ -146,7 +154,7 @@ void powermgmt_init(void); | |||
146 | /* Returns battery statust */ | 154 | /* Returns battery statust */ |
147 | int battery_level(void); /* percent */ | 155 | int battery_level(void); /* percent */ |
148 | int battery_time(void); /* minutes */ | 156 | int battery_time(void); /* minutes */ |
149 | int battery_adc_voltage(void); /* voltage from ADC in millivolts */ | 157 | unsigned int battery_adc_voltage(void); /* voltage from ADC in millivolts */ |
150 | unsigned int battery_voltage(void); /* filtered batt. voltage in millivolts */ | 158 | unsigned int battery_voltage(void); /* filtered batt. voltage in millivolts */ |
151 | 159 | ||
152 | /* read unfiltered battery info */ | 160 | /* read unfiltered battery info */ |