diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-09-01 23:36:15 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-09-01 23:36:15 +0000 |
commit | f05cdc46f23bf28d31dfc4fc2ebe4d20e4d6f961 (patch) | |
tree | 26fb9244e04ffd4297cb918ae8c7de2b731dd28a /apps | |
parent | c00fbc4d06dee2f075e8bb1671350c3079c992bf (diff) | |
download | rockbox-f05cdc46f23bf28d31dfc4fc2ebe4d20e4d6f961.tar.gz rockbox-f05cdc46f23bf28d31dfc4fc2ebe4d20e4d6f961.zip |
Android: don't compile powermgmt-sim.c
Instead implement a bit of battery monitoring. Currently it only fetches the battery level (in %) every 30s,
but it could do more like battery status, charger connected, voltage...
Theoretically, we could also exit/quit after some time of inactivity too
(perhaps not a bad idea since Rockbox puts a slight but still non-zero CPU load even if doing nothing).
Ironically, Rockbox is now the only way to get the exact battery level (at least I haven't found anything yet) on my phone :-)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27974 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.c | 3 | ||||
-rw-r--r-- | apps/settings.h | 2 | ||||
-rw-r--r-- | apps/settings_list.c | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/apps/settings.c b/apps/settings.c index 3a851df0ff..e9f0dc9330 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -852,7 +852,10 @@ void settings_apply(bool read_disk) | |||
852 | #endif | 852 | #endif |
853 | set_poweroff_timeout(global_settings.poweroff); | 853 | set_poweroff_timeout(global_settings.poweroff); |
854 | 854 | ||
855 | #if defined(BATTERY_CAPACITY_INC) && BATTERY_CAPACITY_INC > 0 | ||
855 | set_battery_capacity(global_settings.battery_capacity); | 856 | set_battery_capacity(global_settings.battery_capacity); |
857 | #endif | ||
858 | |||
856 | #if BATTERY_TYPES_COUNT > 1 | 859 | #if BATTERY_TYPES_COUNT > 1 |
857 | set_battery_type(global_settings.battery_type); | 860 | set_battery_type(global_settings.battery_type); |
858 | #endif | 861 | #endif |
diff --git a/apps/settings.h b/apps/settings.h index 7deb2def41..3ba8fe9868 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -619,7 +619,9 @@ struct user_settings | |||
619 | 619 | ||
620 | /* power settings */ | 620 | /* power settings */ |
621 | int poweroff; /* idle power off timer */ | 621 | int poweroff; /* idle power off timer */ |
622 | #if defined(BATTERY_CAPACITY_INC) && BATTERY_CAPACITY_INC > 0 | ||
622 | int battery_capacity; /* in mAh */ | 623 | int battery_capacity; /* in mAh */ |
624 | #endif | ||
623 | 625 | ||
624 | #if BATTERY_TYPES_COUNT > 1 | 626 | #if BATTERY_TYPES_COUNT > 1 |
625 | int battery_type; /* for units which can take multiple types (Ondio). */ | 627 | int battery_type; /* for units which can take multiple types (Ondio). */ |
diff --git a/apps/settings_list.c b/apps/settings_list.c index cab326671a..5a9eeb90ce 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -763,7 +763,7 @@ const struct settings_list settings[] = { | |||
763 | #endif | 763 | #endif |
764 | "max files in dir", UNIT_INT, 50, 10000, 50, | 764 | "max files in dir", UNIT_INT, 50, 10000, 50, |
765 | NULL, NULL, NULL), | 765 | NULL, NULL, NULL), |
766 | #if BATTERY_CAPACITY_INC > 0 | 766 | #if defined(BATTERY_CAPACITY_INC) && BATTERY_CAPACITY_INC > 0 |
767 | INT_SETTING(0, battery_capacity, LANG_BATTERY_CAPACITY, | 767 | INT_SETTING(0, battery_capacity, LANG_BATTERY_CAPACITY, |
768 | BATTERY_CAPACITY_DEFAULT, "battery capacity", UNIT_MAH, | 768 | BATTERY_CAPACITY_DEFAULT, "battery capacity", UNIT_MAH, |
769 | BATTERY_CAPACITY_MIN, BATTERY_CAPACITY_MAX, | 769 | BATTERY_CAPACITY_MIN, BATTERY_CAPACITY_MAX, |