From 4cff03012e995413fa0e6dce55219781cb98192f Mon Sep 17 00:00:00 2001 From: Uwe Freese Date: Sun, 15 Dec 2002 18:12:00 +0000 Subject: battery capacity setting, not saved to RTC/disk yet git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3002 a1c6a512-1295-4272-9138-f99709370657 --- apps/settings.c | 1 + apps/settings.h | 8 ++++++++ apps/settings_menu.c | 25 +++++++++++++++++++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/settings.c b/apps/settings.c index e854f6207d..64a1a8c0a2 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -831,6 +831,7 @@ void settings_reset(void) { global_settings.backlight_timeout = DEFAULT_BACKLIGHT_TIMEOUT_SETTING; global_settings.backlight_on_when_charging = DEFAULT_BACKLIGHT_ON_WHEN_CHARGING_SETTING; + global_settings.battery_capacity = 0; /* 1500 mAh */ global_settings.trickle_charge = true; global_settings.dirfilter = SHOW_MUSIC; global_settings.sort_case = false; diff --git a/apps/settings.h b/apps/settings.h index ac5d2301a3..a2f7692d88 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -85,6 +85,14 @@ struct user_settings bool backlight_on_when_charging; bool discharge; /* maintain charge of at least: false = 85%, true = 10% */ bool trickle_charge; /* do trickle charging: 0=off, 1=on */ + int battery_capacity; /* 0 = 1500 mAh + 1 = 1600 mAh + 2 = 1700 mAh + 3 = 1800 mAh + 4 = 1900 mAh + 5 = 2000 mAh + 6 = 2100 mAh + 7 = 2200 mAh */ /* resume settings */ diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 57df93786c..c33b26b07d 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -428,6 +428,26 @@ static bool bidir_limit(void) } #endif +/** + * Menu to set the battery capacity + */ +static bool battery_capacity(void) { + bool retval = false; + + char* names[] = { "1500 mAh ", "1600 mAh ", + "1700 mAh ", "1800 mAh ", + "1900 mAh ", "2000 mAh ", + "2100 mAh ", "2200 mAh " + }; + + retval = set_option( str(LANG_BATTERY_CAPACITY), + &global_settings.battery_capacity, names, 8, NULL); + + set_battery_capacity(global_settings.battery_capacity); + + return retval; +} + #ifdef HAVE_CHARGE_CTRL static bool deep_discharge(void) { @@ -720,9 +740,10 @@ static bool system_settings_menu(void) #ifdef HAVE_ATA_POWER_OFF { str(LANG_POWEROFF), poweroff }, #endif + { str(LANG_BATTERY_CAPACITY), battery_capacity }, #ifdef HAVE_CHARGE_CTRL - { str(LANG_DISCHARGE), deep_discharge }, - { str(LANG_TRICKLE_CHARGE), trickle_charge }, + { str(LANG_DISCHARGE), deep_discharge }, + { str(LANG_TRICKLE_CHARGE), trickle_charge }, #endif #ifdef HAVE_LCD_BITMAP { str(LANG_TIME), timedate_set }, -- cgit v1.2.3