summaryrefslogtreecommitdiff
path: root/firmware/export/config.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-01-03 23:44:38 +0000
committerThomas Martitz <kugel@rockbox.org>2012-01-03 23:44:38 +0000
commitc1bd9b0361ba92c29ceef68d74093e70a1a3e481 (patch)
tree1a42acdf2099b7f5ac06eee11e1d488b388c6d9f /firmware/export/config.h
parent949e6398c89e3c277a4c542f67a5ee788c6f642d (diff)
downloadrockbox-c1bd9b0361ba92c29ceef68d74093e70a1a3e481.tar.gz
rockbox-c1bd9b0361ba92c29ceef68d74093e70a1a3e481.zip
Rework powermgmt to enable code re-use on appliation and sims.
* Introduce CONFIG_BATTERY_MEASURE define, to allow targets (application) to break powermgmt.c's assumption about the ability to read battery voltage. There's now additionally percentage (android) and remaining time measure (maemo). No measure at all also works (sdl app). If voltage can't be measured, then battery_level() is king and it'll be used for power_history and runtime estimation. * Implement target's API in the simulator, i.e. _battery_voltage(), so it doesn't need to implement it's own powermgmt.c and other stubs. Now the sim behaves much more like a native target, although it still changes the simulated battery voltage quickly, * Other changes include include renaming battery_adc_voltage() to _battery_voltage(), for consistency with the new target functions and making some of the apps code aware that voltage and runtime estimation is not always available. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31548 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/config.h')
-rw-r--r--firmware/export/config.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h
index f5bc7788d7..85c83015bd 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -184,6 +184,15 @@
184 * charging or specific programming is required to 184 * charging or specific programming is required to
185 * use the charging hardware. */ 185 * use the charging hardware. */
186 186
187/* CONFIG_BATTERY_MEASURE bits */
188#define VOLTAGE_MEASURE 1 /* Target can report battery voltage
189 * Usually native ports */
190#define PERCENTAGE_MEASURE 2 /* Target can report remaining capacity in %
191 * Usually application/hosted ports */
192#define TIME_MEASURE 4 /* Target can report remaining time estimation
193 Usually application ports, and only
194 if the estimation is better that ours
195 (which it probably is) */
187/* CONFIG_LCD */ 196/* CONFIG_LCD */
188#define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */ 197#define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
189#define LCD_SSD1801 2 /* as used by Archos Player/Studio */ 198#define LCD_SSD1801 2 /* as used by Archos Player/Studio */
@@ -603,6 +612,11 @@ Lyre prototype 1 */
603#define CONFIG_CHARGING 0 612#define CONFIG_CHARGING 0
604#endif 613#endif
605 614
615#ifndef CONFIG_BATTERY_MEASURE
616#define CONFIG_BATTERY_MEASURE 0
617#define NO_LOW_BATTERY_SHUTDOWN
618#endif
619
606#ifndef CONFIG_RTC 620#ifndef CONFIG_RTC
607#define CONFIG_RTC 0 621#define CONFIG_RTC 0
608#endif 622#endif
@@ -611,6 +625,10 @@ Lyre prototype 1 */
611#define BATTERY_TYPES_COUNT 0 625#define BATTERY_TYPES_COUNT 0
612#endif 626#endif
613 627
628#ifndef BATTERY_CAPACITY_DEFAULT
629#define BATTERY_CAPACITY_DEFAULT 0
630#endif
631
614#ifndef BATTERY_CAPACITY_INC 632#ifndef BATTERY_CAPACITY_INC
615#define BATTERY_CAPACITY_INC 0 633#define BATTERY_CAPACITY_INC 0
616#endif 634#endif