···686686#if BATTERY_CAPACITY_INC > 0
687687 int battery_capacity; /* in mAh */
688688#endif
689689-#if BATTERY_TYPES_COUNT > 1
690690- int battery_type; /* for units which can take multiple types (Ondio). */
691691-#endif
692689#ifdef HAVE_SPDIF_POWER
693690 bool spdif_enable; /* S/PDIF power on/off */
694691#endif
···3232/* Define this to the CPU frequency */
3333#define CPU_FREQ 1008000000
34343535-/* Battery */
3636-#define BATTERY_TYPES_COUNT 1
3737-3835/* Audio codec */
3936#define HAVE_ROCKER_CODEC
4037
···125125#define BATTERY_CAPACITY_MIN 830 /* min. capacity selectable */
126126#define BATTERY_CAPACITY_MAX 830 /* max. capacity selectable */
127127#define BATTERY_CAPACITY_INC 25 /* capacity increment */
128128-#define BATTERY_TYPES_COUNT 1 /* only one type */
128128+129129130130#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
131131
+1-1
firmware/export/config/gigabeats.h
···170170#define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */
171171#define BATTERY_CAPACITY_MAX 1200 /* max. capacity selectable */
172172#define BATTERY_CAPACITY_INC 25 /* capacity increment */
173173-#define BATTERY_TYPES_COUNT 1 /* only one type */
173173+174174175175#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
176176
+1-1
firmware/export/config/gogearhdd1630.h
···138138#define BATTERY_CAPACITY_MIN 600 /* min. capacity selectable */
139139#define BATTERY_CAPACITY_MAX 700 /* max. capacity selectable */
140140#define BATTERY_CAPACITY_INC 0 /* capacity increment */
141141-#define BATTERY_TYPES_COUNT 1 /* only one type */
141141+142142143143#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
144144
+1-1
firmware/export/config/gogearhdd6330.h
···143143#define BATTERY_CAPACITY_MIN 600 /* min. capacity selectable */
144144#define BATTERY_CAPACITY_MAX 900 /* max. capacity selectable */
145145#define BATTERY_CAPACITY_INC 20 /* capacity increment */
146146-#define BATTERY_TYPES_COUNT 1 /* only one type */
146146+147147148148#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
149149
+1-1
firmware/export/config/gogearsa9200.h
···126126#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */
127127#define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */
128128#define BATTERY_CAPACITY_INC 0 /* capacity increment */
129129-#define BATTERY_TYPES_COUNT 1 /* only one type */
129129+130130131131#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
132132
+1-1
firmware/export/config/hifietma8.h
···102102#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
103103#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
104104#define BATTERY_CAPACITY_INC 10 /* capacity increment */
105105-#define BATTERY_TYPES_COUNT 1 /* only one type */
105105+106106107107#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
108108
+1-1
firmware/export/config/hifietma8c.h
···102102#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
103103#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
104104#define BATTERY_CAPACITY_INC 10 /* capacity increment */
105105-#define BATTERY_TYPES_COUNT 1 /* only one type */
105105+106106107107#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
108108
+1-1
firmware/export/config/hifietma9.h
···102102#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
103103#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
104104#define BATTERY_CAPACITY_INC 10 /* capacity increment */
105105-#define BATTERY_TYPES_COUNT 1 /* only one type */
105105+106106107107#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
108108
+1-1
firmware/export/config/hifietma9c.h
···102102#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
103103#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
104104#define BATTERY_CAPACITY_INC 10 /* capacity increment */
105105-#define BATTERY_TYPES_COUNT 1 /* only one type */
105105+106106107107#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
108108
+1-1
firmware/export/config/hifimanhm60x.h
···128128#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
129129#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
130130#define BATTERY_CAPACITY_INC 10 /* capacity increment */
131131-#define BATTERY_TYPES_COUNT 1 /* only one type */
131131+132132133133#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
134134
+1-1
firmware/export/config/hifimanhm801.h
···116116#define BATTERY_CAPACITY_MIN 3000 /* min. capacity selectable */
117117#define BATTERY_CAPACITY_MAX 4100 /* max. capacity selectable */
118118#define BATTERY_CAPACITY_INC 50 /* capacity increment */
119119-#define BATTERY_TYPES_COUNT 1 /* only one type */
119119+120120121121#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
122122
+1-1
firmware/export/config/iaudiom3.h
···110110#define BATTERY_CAPACITY_MIN 950 /* min. capacity selectable */
111111#define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */
112112#define BATTERY_CAPACITY_INC 50 /* capacity increment */
113113-#define BATTERY_TYPES_COUNT 1 /* only one type */
113113+114114115115#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
116116
+1-1
firmware/export/config/iaudiom5.h
···134134#define BATTERY_CAPACITY_MIN 950 /* min. capacity selectable */
135135#define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */
136136#define BATTERY_CAPACITY_INC 50 /* capacity increment */
137137-#define BATTERY_TYPES_COUNT 1 /* only one type */
137137+138138139139#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
140140
+1-1
firmware/export/config/iaudiox5.h
···140140#define BATTERY_CAPACITY_MIN 950 /* min. capacity selectable */
141141#define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */
142142#define BATTERY_CAPACITY_INC 50 /* capacity increment */
143143-#define BATTERY_TYPES_COUNT 1 /* only one type */
143143+144144145145#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
146146
+1-1
firmware/export/config/ibassodx50.h
···111111#define BATTERY_CAPACITY_MIN 1700 /* min. capacity selectable */
112112#define BATTERY_CAPACITY_MAX 7300 /* max. capacity selectable */
113113#define BATTERY_CAPACITY_INC 50 /* capacity increment */
114114-#define BATTERY_TYPES_COUNT 1 /* only one type */
114114+115115116116#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
117117#define CONFIG_CHARGING CHARGING_MONITOR
+1-1
firmware/export/config/ibassodx90.h
···110110#define BATTERY_CAPACITY_MIN 1700 /* min. capacity selectable */
111111#define BATTERY_CAPACITY_MAX 7300 /* max. capacity selectable */
112112#define BATTERY_CAPACITY_INC 50 /* capacity increment */
113113-#define BATTERY_TYPES_COUNT 1 /* only one type */
113113+114114115115#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
116116
+1-1
firmware/export/config/ihifi760.h
···127127#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
128128#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
129129#define BATTERY_CAPACITY_INC 10 /* capacity increment */
130130-#define BATTERY_TYPES_COUNT 1 /* only one type */
130130+131131132132#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
133133
+1-1
firmware/export/config/ihifi770.h
···126126#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
127127#define BATTERY_CAPACITY_MAX 1050 /* max. capacity selectable */
128128#define BATTERY_CAPACITY_INC 10 /* capacity increment */
129129-#define BATTERY_TYPES_COUNT 1 /* only one type */
129129+130130131131#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
132132
+1-1
firmware/export/config/ihifi770c.h
···126126#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
127127#define BATTERY_CAPACITY_MAX 1050 /* max. capacity selectable */
128128#define BATTERY_CAPACITY_INC 10 /* capacity increment */
129129-#define BATTERY_TYPES_COUNT 1 /* only one type */
129129+130130131131#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
132132
+1-1
firmware/export/config/ihifi800.h
···127127#define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */
128128#define BATTERY_CAPACITY_MAX 1400 /* max. capacity selectable */
129129#define BATTERY_CAPACITY_INC 10 /* capacity increment */
130130-#define BATTERY_TYPES_COUNT 1 /* only one type */
130130+131131132132#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
133133
+1-1
firmware/export/config/ihifi960.h
···128128#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
129129#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
130130#define BATTERY_CAPACITY_INC 10 /* capacity increment */
131131-#define BATTERY_TYPES_COUNT 1 /* only one type */
131131+132132133133#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
134134
+1-1
firmware/export/config/ipod1g2g.h
···127127#define BATTERY_CAPACITY_MIN 1200 /* min. capacity selectable */
128128#define BATTERY_CAPACITY_MAX 1900 /* max. capacity selectable */
129129#define BATTERY_CAPACITY_INC 50 /* capacity increment */
130130-#define BATTERY_TYPES_COUNT 1 /* only one type */
130130+131131132132#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
133133
+1-1
firmware/export/config/ipod3g.h
···133133#define BATTERY_CAPACITY_MIN 630 /* min. capacity selectable */
134134#define BATTERY_CAPACITY_MAX 1200 /* max. capacity selectable */
135135#define BATTERY_CAPACITY_INC 10 /* capacity increment */
136136-#define BATTERY_TYPES_COUNT 1 /* only one type */
136136+137137138138#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
139139
+1-1
firmware/export/config/ipod4g.h
···140140#define BATTERY_CAPACITY_MIN 630 /* min. capacity selectable */
141141#define BATTERY_CAPACITY_MAX 1200 /* max. capacity selectable */
142142#define BATTERY_CAPACITY_INC 10 /* capacity increment */
143143-#define BATTERY_TYPES_COUNT 1 /* only one type */
143143+144144145145#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
146146
+1-1
firmware/export/config/ipod6g.h
···148148#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
149149#define BATTERY_CAPACITY_MAX 3000 /* max. capacity selectable */
150150#define BATTERY_CAPACITY_INC 10 /* capacity increment */
151151-#define BATTERY_TYPES_COUNT 1 /* only one type */
151151+152152153153#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
154154
+1-1
firmware/export/config/ipodcolor.h
···127127#define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */
128128#define BATTERY_CAPACITY_MAX 1200 /* max. capacity selectable */
129129#define BATTERY_CAPACITY_INC 10 /* capacity increment */
130130-#define BATTERY_TYPES_COUNT 1 /* only one type */
130130+131131132132#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
133133
+1-1
firmware/export/config/ipodmini1g.h
···137137#define BATTERY_CAPACITY_MIN 400 /* min. capacity selectable */
138138#define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable */
139139#define BATTERY_CAPACITY_INC 10 /* capacity increment */
140140-#define BATTERY_TYPES_COUNT 1 /* only one type */
140140+141141142142#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
143143
+1-1
firmware/export/config/ipodmini2g.h
···138138#define BATTERY_CAPACITY_MIN 400 /* min. capacity selectable */
139139#define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable */
140140#define BATTERY_CAPACITY_INC 50 /* capacity increment */
141141-#define BATTERY_TYPES_COUNT 1 /* only one type */
141141+142142143143#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
144144
+1-1
firmware/export/config/ipodnano1g.h
···131131#define BATTERY_CAPACITY_MIN 200 /* min. capacity selectable */
132132#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
133133#define BATTERY_CAPACITY_INC 20 /* capacity increment */
134134-#define BATTERY_TYPES_COUNT 1 /* only one type */
134134+135135136136#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
137137
+1-1
firmware/export/config/ipodnano2g.h
···144144#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
145145#define BATTERY_CAPACITY_MAX 500 /* max. capacity selectable */
146146#define BATTERY_CAPACITY_INC 10 /* capacity increment */
147147-#define BATTERY_TYPES_COUNT 1 /* only one type */
147147+148148149149#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
150150
+1-1
firmware/export/config/ipodvideo.h
···147147#define BATTERY_CAPACITY_MAX 3000 /* max. capacity selectable --
148148 3rd party batteries go this high */
149149#define BATTERY_CAPACITY_INC 50 /* capacity increment */
150150-#define BATTERY_TYPES_COUNT 1 /* only one type */
150150+151151152152#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
153153
+1-1
firmware/export/config/iriverh10.h
···119119#define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */
120120#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
121121#define BATTERY_CAPACITY_INC 50 /* capacity increment */
122122-#define BATTERY_TYPES_COUNT 1 /* only one type */
122122+123123124124#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
125125
+1-1
firmware/export/config/iriverh100.h
···121121#define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */
122122#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
123123#define BATTERY_CAPACITY_INC 50 /* capacity increment */
124124-#define BATTERY_TYPES_COUNT 1 /* only one type */
124124+125125126126#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
127127
+1-1
firmware/export/config/iriverh10_5gb.h
···105105#define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */
106106#define BATTERY_CAPACITY_MAX 900 /* max. capacity selectable */
107107#define BATTERY_CAPACITY_INC 10 /* capacity increment */
108108-#define BATTERY_TYPES_COUNT 1 /* only one type */
108108+109109110110#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
111111
+1-1
firmware/export/config/iriverh120.h
···126126#define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */
127127#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
128128#define BATTERY_CAPACITY_INC 50 /* capacity increment */
129129-#define BATTERY_TYPES_COUNT 1 /* only one type */
129129+130130131131#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
132132
+1-1
firmware/export/config/iriverh300.h
···130130#define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */
131131#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
132132#define BATTERY_CAPACITY_INC 50 /* capacity increment */
133133-#define BATTERY_TYPES_COUNT 1 /* only one type */
133133+134134135135#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
136136
+1-1
firmware/export/config/lyreproto1.h
···8383#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
8484#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
8585#define BATTERY_CAPACITY_INC 100 /* capacity increment */
8686-#define BATTERY_TYPES_COUNT 1 /* only one type */
8686+87878888#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
8989
+1-1
firmware/export/config/meizum3.h
···115115#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
116116#define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */
117117#define BATTERY_CAPACITY_INC 50 /* capacity increment */
118118-#define BATTERY_TYPES_COUNT 1 /* only one type */
118118+119119120120#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
121121
+1-1
firmware/export/config/meizum6sl.h
···115115#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
116116#define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */
117117#define BATTERY_CAPACITY_INC 50 /* capacity increment */
118118-#define BATTERY_TYPES_COUNT 1 /* only one type */
118118+119119120120#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
121121
+1-1
firmware/export/config/meizum6sp.h
···121121#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
122122#define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */
123123#define BATTERY_CAPACITY_INC 50 /* capacity increment */
124124-#define BATTERY_TYPES_COUNT 1 /* only one type */
124124+125125126126#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
127127
+1-1
firmware/export/config/mini2440.h
···9393#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
9494#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
9595#define BATTERY_CAPACITY_INC 100 /* capacity increment */
9696-#define BATTERY_TYPES_COUNT 1 /* only one type */
9696+97979898#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
9999
···137137#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */
138138#define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */
139139#define BATTERY_CAPACITY_INC 0 /* capacity increment */
140140-#define BATTERY_TYPES_COUNT 1 /* only one type */
140140+141141142142#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
143143
+1-1
firmware/export/config/mrobe500.h
···188188#define BATTERY_CAPACITY_MIN 1000 /* min. capacity selectable */
189189#define BATTERY_CAPACITY_MAX 2000 /* max. capacity selectable */
190190#define BATTERY_CAPACITY_INC 100 /* capacity increment */
191191-#define BATTERY_TYPES_COUNT 1 /* only one type */
191191+192192193193#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
194194
+1-1
firmware/export/config/ondavx747.h
···145145#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
146146#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
147147#define BATTERY_CAPACITY_INC 100 /* capacity increment */
148148-#define BATTERY_TYPES_COUNT 1 /* only one type */
148148+149149150150#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
151151
+1-1
firmware/export/config/ondavx767.h
···128128#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
129129#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
130130#define BATTERY_CAPACITY_INC 100 /* capacity increment */
131131-#define BATTERY_TYPES_COUNT 1 /* only one type */
131131+132132133133#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
134134
+1-1
firmware/export/config/ondavx777.h
···139139#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
140140#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
141141#define BATTERY_CAPACITY_INC 100 /* capacity increment */
142142-#define BATTERY_TYPES_COUNT 1 /* only one type */
142142+143143144144#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
145145
+1-1
firmware/export/config/rk27generic.h
···136136#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
137137#define BATTERY_CAPACITY_MAX 500 /* max. capacity selectable */
138138#define BATTERY_CAPACITY_INC 10 /* capacity increment */
139139-#define BATTERY_TYPES_COUNT 1 /* only one type */
139139+140140141141#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
142142
+1-1
firmware/export/config/samsungyh820.h
···139139#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
140140#define BATTERY_CAPACITY_MAX 800 /* max. capacity selectable */
141141#define BATTERY_CAPACITY_INC 50 /* capacity increment */
142142-#define BATTERY_TYPES_COUNT 1 /* only one type */
142142+143143144144#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
145145
+1-1
firmware/export/config/samsungyh920.h
···148148#define BATTERY_CAPACITY_MIN 900 /* min. capacity selectable */
149149#define BATTERY_CAPACITY_MAX 1600 /* max. capacity selectable */
150150#define BATTERY_CAPACITY_INC 50 /* capacity increment */
151151-#define BATTERY_TYPES_COUNT 1 /* only one type */
151151+152152153153#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
154154
+1-1
firmware/export/config/samsungyh925.h
···146146#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
147147#define BATTERY_CAPACITY_MAX 1150 /* max. capacity selectable */
148148#define BATTERY_CAPACITY_INC 50 /* capacity increment */
149149-#define BATTERY_TYPES_COUNT 1 /* only one type */
149149+150150151151#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
152152
+1-1
firmware/export/config/samsungypr0.h
···129129#define BATTERY_CAPACITY_MIN 600 /* min. capacity selectable */
130130#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
131131#define BATTERY_CAPACITY_INC 0 /* capacity increment */
132132-#define BATTERY_TYPES_COUNT 1 /* only one type */
132132+133133134134#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
135135
+1-1
firmware/export/config/samsungypr1.h
···118118#define BATTERY_CAPACITY_MIN 600 /* min. capacity selectable */
119119#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
120120#define BATTERY_CAPACITY_INC 0 /* capacity increment */
121121-#define BATTERY_TYPES_COUNT 1 /* only one type */
121121+122122123123/* R1's fuel gauge max17040 can supply both kind of values */
124124#define CONFIG_BATTERY_MEASURE PERCENTAGE_MEASURE
+1-1
firmware/export/config/samsungyps3.h
···113113#define BATTERY_CAPACITY_MIN 580 /* min. capacity selectable */
114114#define BATTERY_CAPACITY_MAX 580 /* max. capacity selectable */
115115#define BATTERY_CAPACITY_INC 0 /* capacity increment */
116116-#define BATTERY_TYPES_COUNT 1 /* only one type */
116116+117117118118#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
119119
+1-1
firmware/export/config/sansac200.h
···138138#define BATTERY_CAPACITY_MIN 530 /* min. capacity selectable */
139139#define BATTERY_CAPACITY_MAX 530 /* max. capacity selectable */
140140#define BATTERY_CAPACITY_INC 0 /* capacity increment */
141141-#define BATTERY_TYPES_COUNT 1 /* only one type */
141141+142142143143#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
144144
+1-1
firmware/export/config/sansac200v2.h
···132132#define BATTERY_CAPACITY_MIN 530 /* min. capacity selectable */
133133#define BATTERY_CAPACITY_MAX 530 /* max. capacity selectable */
134134#define BATTERY_CAPACITY_INC 0 /* capacity increment */
135135-#define BATTERY_TYPES_COUNT 1 /* only one type */
135135+136136137137#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
138138
+1-1
firmware/export/config/sansaclip.h
···135135#define BATTERY_CAPACITY_MIN 330 /* min. capacity selectable */
136136#define BATTERY_CAPACITY_MAX 330 /* max. capacity selectable */
137137#define BATTERY_CAPACITY_INC 0 /* capacity increment */
138138-#define BATTERY_TYPES_COUNT 1 /* only one type */
138138+139139140140#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
141141
+1-1
firmware/export/config/sansaclipplus.h
···155155#define BATTERY_CAPACITY_MIN 290 /* min. capacity selectable */
156156#define BATTERY_CAPACITY_MAX 290 /* max. capacity selectable */
157157#define BATTERY_CAPACITY_INC 0 /* capacity increment */
158158-#define BATTERY_TYPES_COUNT 1 /* only one type */
158158+159159160160#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
161161
+1-1
firmware/export/config/sansaclipv2.h
···142142#define BATTERY_CAPACITY_MIN 380 /* min. capacity selectable */
143143#define BATTERY_CAPACITY_MAX 380 /* max. capacity selectable */
144144#define BATTERY_CAPACITY_INC 0 /* capacity increment */
145145-#define BATTERY_TYPES_COUNT 1 /* only one type */
145145+146146147147#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
148148
+1-1
firmware/export/config/sansaclipzip.h
···148148#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
149149#define BATTERY_CAPACITY_MAX 300 /* max. capacity selectable */
150150#define BATTERY_CAPACITY_INC 0 /* capacity increment */
151151-#define BATTERY_TYPES_COUNT 1 /* only one type */
151151+152152153153#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
154154
+1-1
firmware/export/config/sansaconnect.h
···147147#define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */
148148#define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */
149149#define BATTERY_CAPACITY_INC 100 /* capacity increment */
150150-#define BATTERY_TYPES_COUNT 1 /* only one type */
150150+151151152152/* bq27000 provides voltage, percentage and time measure.
153153 * Voltage reading is available every 2.56 seconds and does not need filtering.
+1-1
firmware/export/config/sansae200.h
···145145#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */
146146#define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */
147147#define BATTERY_CAPACITY_INC 0 /* capacity increment */
148148-#define BATTERY_TYPES_COUNT 1 /* only one type */
148148+149149150150#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
151151
+1-1
firmware/export/config/sansae200v2.h
···158158#define BATTERY_CAPACITY_MIN 730 /* min. capacity selectable */
159159#define BATTERY_CAPACITY_MAX 730 /* max. capacity selectable */
160160#define BATTERY_CAPACITY_INC 0 /* capacity increment */
161161-#define BATTERY_TYPES_COUNT 1 /* only one type */
161161+162162163163#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
164164
+1-1
firmware/export/config/sansafuze.h
···158158#define BATTERY_CAPACITY_MIN 550 /* min. capacity selectable */
159159#define BATTERY_CAPACITY_MAX 550 /* max. capacity selectable */
160160#define BATTERY_CAPACITY_INC 0 /* capacity increment */
161161-#define BATTERY_TYPES_COUNT 1 /* only one type */
161161+162162163163#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
164164
+1-1
firmware/export/config/sansafuzeplus.h
···151151#define BATTERY_CAPACITY_MIN 550 /* min. capacity selectable */
152152#define BATTERY_CAPACITY_MAX 550 /* max. capacity selectable */
153153#define BATTERY_CAPACITY_INC 0 /* capacity increment */
154154-#define BATTERY_TYPES_COUNT 1 /* only one type */
154154+155155156156#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
157157
+1-1
firmware/export/config/sansafuzev2.h
···163163#define BATTERY_CAPACITY_MIN 550 /* min. capacity selectable */
164164#define BATTERY_CAPACITY_MAX 550 /* max. capacity selectable */
165165#define BATTERY_CAPACITY_INC 0 /* capacity increment */
166166-#define BATTERY_TYPES_COUNT 1 /* only one type */
166166+167167168168#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
169169
+1-1
firmware/export/config/sansam200v4.h
···112112#define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */
113113#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
114114#define BATTERY_CAPACITY_INC 50 /* capacity increment */
115115-#define BATTERY_TYPES_COUNT 1 /* only one type */
115115+116116117117#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
118118
+1-1
firmware/export/config/sansaview.h
···119119#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */
120120#define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */
121121#define BATTERY_CAPACITY_INC 0 /* capacity increment */
122122-#define BATTERY_TYPES_COUNT 1 /* only one type */
122122+123123124124#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
125125
···125125#define BATTERY_CAPACITY_MIN 550 /* min. capacity selectable */
126126#define BATTERY_CAPACITY_MAX 550 /* max. capacity selectable */
127127#define BATTERY_CAPACITY_INC 0 /* capacity increment */
128128-#define BATTERY_TYPES_COUNT 1 /* only one type */
128128+129129130130#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
131131
+1-1
firmware/export/config/sonynwze370.h
···125125#define BATTERY_CAPACITY_MIN 550 /* min. capacity selectable */
126126#define BATTERY_CAPACITY_MAX 550 /* max. capacity selectable */
127127#define BATTERY_CAPACITY_INC 0 /* capacity increment */
128128-#define BATTERY_TYPES_COUNT 1 /* only one type */
128128+129129130130#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
131131
-3
firmware/export/config/sonynwzlinux.h
···117117#endif
118118#define HAVE_STORAGE_FLUSH
119119120120-/* Battery */
121121-#define BATTERY_TYPES_COUNT 1
122122-123120/* special define to be use in various places */
124121#define SONY_NWZ_LINUX
125122
+1-1
firmware/export/config/vibe500.h
···119119#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
120120#define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable */
121121#define BATTERY_CAPACITY_INC 50 /* capacity increment */
122122-#define BATTERY_TYPES_COUNT 1 /* only one type */
122122+123123124124#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
125125
-3
firmware/export/config/xduoox20.h
···3030/* Define this to the CPU frequency */
3131#define CPU_FREQ 1008000000
32323333-/* Battery */
3434-#define BATTERY_TYPES_COUNT 1
3535-3633/* Audio codec */
3734#define HAVE_XDUOO_LINUX_CODEC
3835
···3131/* Define this to the CPU frequency */
3232#define CPU_FREQ 1008000000
33333434-/* Battery */
3535-#define BATTERY_TYPES_COUNT 1
3636-3734/* Audio codec */
3835#define HAVE_XDUOO_LINUX_CODEC
3936
+1-1
firmware/export/config/zenvision.h
···126126#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
127127#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
128128#define BATTERY_CAPACITY_INC 100 /* capacity increment */
129129-#define BATTERY_TYPES_COUNT 1 /* only one type */
129129+130130131131#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
132132
+1-1
firmware/export/config/zenvisionm30gb.h
···127127#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
128128#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
129129#define BATTERY_CAPACITY_INC 100 /* capacity increment */
130130-#define BATTERY_TYPES_COUNT 1 /* only one type */
130130+131131132132#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
133133
+1-1
firmware/export/config/zenvisionm60gb.h
···126126#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
127127#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
128128#define BATTERY_CAPACITY_INC 100 /* capacity increment */
129129-#define BATTERY_TYPES_COUNT 1 /* only one type */
129129+130130131131#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
132132
-1
firmware/export/powermgmt.h
···161161void set_battery_capacity(int capacity); /* set local battery capacity value */
162162#endif
163163int get_battery_capacity(void); /* get local battery capacity value */
164164-void set_battery_type(int type); /* set local battery type */
165164166165void set_sleeptimer_duration(int minutes);
167166bool get_sleep_timer_active(void);
+17-36
firmware/powermgmt.c
···56565757#if (BATTERY_CAPACITY_DEFAULT > 0)
5858extern unsigned short power_history[POWER_HISTORY_LEN];
5959-extern unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT];
6060-extern unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT];
6161-extern unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11];
5959+extern unsigned short battery_level_disksafe;
6060+extern unsigned short battery_level_shutoff;
6161+extern unsigned short percent_to_volt_discharge[11];
6262#endif
6363#if CONFIG_CHARGING
6464extern unsigned short percent_to_volt_charge[11];
···7272{
7373#if (BATTERY_CAPACITY_DEFAULT > 0)
7474 .history = power_history,
7575- .disksafe = &battery_level_disksafe[0],
7676- .shutoff = &battery_level_shutoff[0],
7777- .discharge = percent_to_volt_discharge[0],
7575+ .disksafe = &battery_level_disksafe,
7676+ .shutoff = &battery_level_shutoff,
7777+ .discharge = percent_to_volt_discharge,
7878#if CONFIG_CHARGING
7979 .charge = percent_to_volt_charge,
8080#endif
8181- .elems = ARRAYLEN(percent_to_volt_discharge[0]),
8181+ .elems = ARRAYLEN(percent_to_volt_discharge),
8282#endif
8383 .isdefault = true,
8484};
···117117# define battery_capacity BATTERY_CAPACITY_DEFAULT
118118#endif
119119120120-#if BATTERY_TYPES_COUNT > 1
121121-static int battery_type = 0;
122122-#else
123123-#define battery_type 0
124124-#endif
125125-126120/* Power history: power_history[0] is the newest sample */
127121unsigned short power_history[POWER_HISTORY_LEN] = {0};
128122···277271 if(!charger_inserted())
278272#endif
279273 {
280280- voltage_now += (percent_to_volt_discharge[battery_type][6] -
281281- percent_to_volt_discharge[battery_type][5]) / 2;
274274+ voltage_now += (percent_to_volt_discharge[6] -
275275+ percent_to_volt_discharge[5]) / 2;
282276 }
283277#endif /* HAVE_DISK_STORAGE */
284278···377371#endif /* CONFIG_CHARGING >= CHARGING_MONITOR */
378372 {
379373 /* DISCHARGING or error state */
380380- level = voltage_to_percent(millivolts, percent_to_volt_discharge[battery_type]);
374374+ level = voltage_to_percent(millivolts, percent_to_volt_discharge);
381375 }
382376383377 return level;
···480474 }
481475}
482476483483-#if BATTERY_TYPES_COUNT > 1
484484-void set_battery_type(int type)
485485-{
486486- if(type < 0 || type > BATTERY_TYPES_COUNT)
487487- type = 0;
488488-489489- if (type != battery_type) {
490490- battery_type = type;
491491- battery_status_update(); /* recalculate the battery status */
492492- }
493493-}
494494-#endif
495495-496477#if BATTERY_CAPACITY_INC > 0
497478void set_battery_capacity(int capacity)
498479{
···519500#if defined(NO_LOW_BATTERY_SHUTDOWN)
520501 return true;
521502#elif ((CONFIG_BATTERY_MEASURE & PERCENTAGE_MEASURE) && (CONFIG_BATTERY_MEASURE & VOLTAGE_MEASURE))
522522- return voltage_now > battery_level_disksafe[battery_type];
503503+ return voltage_now > battery_level_disksafe;
523504#elif CONFIG_BATTERY_MEASURE & PERCENTAGE_MEASURE
524505 return percent_now > 0;
525506#elif defined(HAVE_BATTERY_SWITCH)
526507 /* Cannot rely upon the battery reading to be valid and the
527508 * device could be powered externally. */
528528- return input_millivolts() > battery_level_disksafe[battery_type];
509509+ return input_millivolts() > battery_level_disksafe;
529510#else
530530- return voltage_now > battery_level_disksafe[battery_type];
511511+ return voltage_now > battery_level_disksafe;
531512#endif
532513}
533514···553534 return false;
554535#elif ((CONFIG_BATTERY_MEASURE & PERCENTAGE_MEASURE) && (CONFIG_BATTERY_MEASURE & VOLTAGE_MEASURE))
555536 /* If we have both, prefer voltage */
556556- return voltage_now < battery_level_shutoff[battery_type];
537537+ return voltage_now < battery_level_shutoff;
557538#elif CONFIG_BATTERY_MEASURE & PERCENTAGE_MEASURE
558539 return percent_now == 0;
559540#elif defined(HAVE_BATTERY_SWITCH)
560541 /* Cannot rely upon the battery reading to be valid and the
561542 * device could be powered externally. */
562562- return input_millivolts() < battery_level_shutoff[battery_type];
543543+ return input_millivolts() < battery_level_shutoff;
563544#else
564564- return voltage_now < battery_level_shutoff[battery_type];
545545+ return voltage_now < battery_level_shutoff;
565546#endif
566547}
567548···905886{
906887#if (BATTERY_CAPACITY_DEFAULT > 0) && !defined(BOOTLOADER)
907888 /* parse and load user battery levels file */
908908-#define PWRELEMS (ARRAYLEN(percent_to_volt_discharge[0]))
889889+#define PWRELEMS (ARRAYLEN(percent_to_volt_discharge))
909890910891911892 unsigned short tmparr[PWRELEMS];
···2828 early uncalibrated values. But read-out value should be correct
2929 */
30303131-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
3232-{
3333- /* TODO: this is just an initial guess */
3434- 900
3535-};
3131+unsigned short battery_level_disksafe = 1000; /* TODO: this is just an initial guess */
3232+3333+unsigned short battery_level_shutoff = 900; /* TODO: this is just an initial guess */
36343737-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
3838-{
3939- /* TODO: this is just an initial guess */
4040- 1000
4141-};
42354336/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
4444-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
3737+unsigned short percent_to_volt_discharge[11] =
4538{
4639 /* TODO: simple uncalibrated curve, linear except for first 10% */
4747- { 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1500 }
4040+ 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1500
4841};
49425043/* ADC should read 0x3ff=5.12V */
···3131 Discharge and charge curves have not been calibrated yet.
3232*/
33333434-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
3535-{
3636- /* OF power off device when this value reached */
3737- 430
3838-};
3434+unsigned short battery_level_disksafe = 430;
39354040-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
4141-{
4242- 425
4343-};
3636+unsigned short battery_level_shutoff = 425; /* OF power off device when this value reached */
44374538/* adc values of 0%, 10%, ... 100% when charging disabled */
4646-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
3939+unsigned short percent_to_volt_discharge[11] =
4740{
4841 /* TODO: simple uncalibrated curve */
4949- { 425, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520 }
4242+ 425, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520
5043};
51445245/* adc values of 0%, 10%, ... 100% when charging enabled */
···3232 Discharge and charge curves have not been calibrated yet.
3333*/
34343535-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
3636-{
3737- /* TODO: this is just an initial guess */
3838- 3400
3939-};
3535+unsigned short battery_level_disksafe = 3400; /* TODO: this is just an initial guess */
40364141-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
4242-{
4343- /* TODO: this is just an initial guess */
4444- 3300
4545-};
3737+unsigned short battery_level_shutoff = 3300; /* TODO: this is just an initial guess */
46384739/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
4848-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
4040+unsigned short percent_to_volt_discharge[11] =
4941{
5042 /* TODO: simple uncalibrated curve, linear except for first 10% */
5151- { 3300, 3600, 3665, 3730, 3795, 3860, 3925, 3990, 4055, 4120, 4185 }
4343+ 3300, 3600, 3665, 3730, 3795, 3860, 3925, 3990, 4055, 4120, 4185
5244};
53455446/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
···3232 Discharge and charge curves have not been calibrated yet.
3333*/
34343535-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
3636-{
3737- /* TODO: this is just an initial guess */
3838- 3400
3939-};
3535+unsigned short battery_level_disksafe = 3400; /* TODO: this is just an initial guess */
40364141-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
4242-{
4343- /* TODO: this is just an initial guess */
4444- 3300
4545-};
3737+unsigned short battery_level_shutoff = 3300; /* TODO: this is just an initial guess */
46384739/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
4848-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
4040+unsigned short percent_to_volt_discharge[11] =
4941{
5042 /* TODO: simple uncalibrated curve, linear except for first 10% */
5151- { 3300, 3600, 3665, 3730, 3795, 3860, 3925, 3990, 4055, 4120, 4185 }
4343+ 3300, 3600, 3665, 3730, 3795, 3860, 3925, 3990, 4055, 4120, 4185
5244};
53455446/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
···2424#include "adc.h"
2525#include "adc-target.h"
26262727-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
2828-{
2929- /* TODO: this is just an initial guess */
3030- 3400
3131-};
2727+unsigned short battery_level_disksafe = 3400;/* TODO: this is just an initial guess */
32283333-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
3434-{
3535- /* TODO: this is just an initial guess */
3636- 3300
3737-};
2929+unsigned short battery_level_shutoff = 3300; /* TODO: this is just an initial guess */
38303931/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
4040-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
3232+unsigned short percent_to_volt_discharge[11] =
4133{
4234 /* TODO: simple uncalibrated curve, linear except for first 10% */
4343- { 3300, 3390, 3480, 3570, 3660, 3750, 3840, 3930, 4020, 4110, 4200 }
3535+ 3300, 3390, 3480, 3570, 3660, 3750, 3840, 3930, 4020, 4110, 4200
4436};
45374638#if CONFIG_CHARGING
+4-10
firmware/target/arm/s5l8702/ipod6g/powermgmt-6g.c
···2626#include "audiohw.h"
2727#include "adc-target.h"
28282929-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
3030-{
3131- 3500
3232-};
2929+unsigned short battery_level_disksafe = 3500;
33303434-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
3535-{
3636- 3300
3737-};
3131+unsigned short battery_level_shutoff = 3300;
38323933/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
4040-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
3434+unsigned short percent_to_volt_discharge[11] =
4135{
4242- { 3500, 3670, 3720, 3750, 3770, 3800, 3860, 3920, 3980, 4070, 4170 }
3636+ 3500, 3670, 3720, 3750, 3770, 3800, 3860, 3920, 3980, 4070, 4170
4337};
44384539#if CONFIG_CHARGING
···3030static unsigned short current_voltage = 4100;
31313232/* This specifies the battery level that writes are still safe */
3333-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
3434-{
3535- 3600
3636-};
3333+unsigned short battery_level_disksafe = 3600;
37343835/* Below this the player cannot be considered to operate reliably */
3939-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
4040-{
4141- 3580
4242-};
3636+unsigned short battery_level_shutoff = 3580;
43374438/* Right now these are linear translations, it would be good to model them
4539 * appropriate to the actual battery curve.
···4842/* 6.10 format */
49435044/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
5151-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
4545+unsigned short percent_to_volt_discharge[11] =
5246{
5353- { 3600, 3650, 3700, 3750, 3800, 3850, 3900, 3950, 4000, 4090, 4150 },
4747+ 3600, 3650, 3700, 3750, 3800, 3850, 3900, 3950, 4000, 4090, 4150
5448};
55495650/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
5751unsigned short percent_to_volt_charge[11] =
5852{
5959- 4000, 4105, 4210, 4315, 4420, 4525, 4630, 4735, 4840, 4945, 5050,
5353+ 4000, 4105, 4210, 4315, 4420, 4525, 4630, 4735, 4840, 4945, 5050
6054};
61556256/* Returns battery voltage from ADC [millivolts] */
···5656}
57575858#if (CONFIG_BATTERY_MEASURE & VOLTAGE_MEASURE) == VOLTAGE_MEASURE
5959-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
6060-{
6161- 3470
6262-};
5959+unsigned short battery_level_disksafe = 3470;
63606461/* the OF shuts down at this voltage */
6565-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
6666-{
6767- 3450
6868-};
6262+unsigned short battery_level_shutoff = 3450;
69637064/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
7171-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
6565+unsigned short percent_to_volt_discharge[11] =
7266{
7373- { 3450, 3502, 3550, 3587, 3623, 3669, 3742, 3836, 3926, 4026, 4200 }
6767+ 3450, 3502, 3550, 3587, 3623, 3669, 3742, 3836, 3926, 4026, 4200
7468};
7569#else /* FIX ME what level should disksafe be?*/
7676-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
7777-{
7878-};
7070+unsigned short battery_level_disksafe = 0;
79718080-/* the OF shuts down at this voltage */
8181-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
8282-{
8383-};
7272+unsigned short battery_level_shutoff = 0;
84738574/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
8686-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
7575+unsigned short percent_to_volt_discharge[11] =
8776{
8877};
8978#endif
+4-10
firmware/target/hosted/sonynwz/powermgmt-nwz.c
···2121#include "power.h"
2222#include "power-nwz.h"
23232424-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
2525-{
2626- 3470
2727-};
2424+unsigned short battery_level_disksafe = 3470;
28252926/* the OF shuts down at this voltage */
3030-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
3131-{
3232- 3450
3333-};
2727+unsigned short battery_level_shutoff = 3450;
34283529/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
3636-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
3030+unsigned short percent_to_volt_discharge[11] =
3731{
3838- { 3450, 3698, 3746, 3781, 3792, 3827, 3882, 3934, 3994, 4060, 4180 }
3232+ 3450, 3698, 3746, 3781, 3792, 3827, 3882, 3934, 3994, 4060, 4180
3933};
40344135/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
+4-10
firmware/target/hosted/xduoo/powermgmt-xduoo.c
···2121#include "power.h"
2222#include "power-xduoo.h"
23232424-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
2525-{
2626- 3443 /* 5% */
2727-};
2424+unsigned short battery_level_disksafe = 3443; /* 5% */
28252926/* the OF shuts down at this voltage */
3030-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
3131-{
3232- 3400
3333-};
2727+unsigned short battery_level_shutoff = 3400; /* 0% */
34283529/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
3636-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
3030+unsigned short percent_to_volt_discharge[11] =
3731{
3838- { 3400, 3498, 3560, 3592, 3624, 3672, 3753, 3840, 3937, 4047, 4189 }
3232+ 3400, 3498, 3560, 3592, 3624, 3672, 3753, 3840, 3937, 4047, 4189
3933};
40344135/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
···4747 * devices is getting confused.
4848 */
49495050-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] =
5151-{
5252- 3470
5353-};
5050+unsigned short battery_level_disksafe = 3470;
54515552/* the OF shuts down at this voltage */
5656-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
5757-{
5858- 3400
5959-};
5353+unsigned short battery_level_shutoff = 3400;
60546155/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
6262-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
5656+unsigned short percent_to_volt_discharge[11] =
6357{
6464- { 3400, 3639, 3697, 3723, 3757, 3786, 3836, 3906, 3980, 4050, 4159 }
5858+ 3400, 3639, 3697, 3723, 3757, 3786, 3836, 3906, 3980, 4050, 4159
6559};
66606761/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
-3
manual/appendix/config_file_options.tex
···8787 brightness & \fixme{devise a way to get ranges from config-*.h} & N/A\\
8888 disk spindown & 3 to 254 & s\\
8989 battery capacity & \fixme{devise a way to get ranges from config-*.h} & mAh\\
9090- \opt{battery_types}{
9191- battery type & alkaline, nimh & N/A\\
9292- }
9390 \opt{HAVE_CAR_ADAPTER_MODE}{
9491 car adapter mode & on, off & N/A\\
9592 }
-7
manual/configure_rockbox/system_options.tex
···4444 \opt{ipod,sansa}{This value is fairly meaningless in the \playerman{}
4545 family at present, and work is on-going into finding a better way to
4646 determine battery life.}
4747-4848- \opt{battery_types}{
4949- \item [Battery Type.] This setting tells Rockbox which type of battery
5050- is currently used in the \dap{}.
5151- \nopt{xduoox3}{The two supported battery types are ``Alkaline'' or ``NiMH''.}
5252- \opt{xduoox3}{Older \playerman{} \playertype{} units shipped with a 1500mAh battery, while newer units ships with a 2000mAh battery. If you are not sure which type you have, older units have a button marked ``ESC''.}
5353- }
5447 }
55485649 \opt{usb_charging_enable}{
+4-4
uisimulator/common/powermgmt-sim.c
···102102 batt_current = charging ? BATT_CHARGE_STEP : BATT_DISCHARGE_STEP;
103103}
104104105105-unsigned short battery_level_disksafe[BATTERY_TYPES_COUNT] = { 3200 };
106106-unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = { 3200 };
105105+unsigned short battery_level_disksafe = 3200;
106106+unsigned short battery_level_shutoff = 3200;
107107108108/* make the simulated curve nicely linear */
109109-unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
110110-{ { 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300 } };
109109+unsigned short percent_to_volt_discharge[11] =
110110+{ 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300 };
111111unsigned short percent_to_volt_charge[11] =
112112{ 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300 };
113113