diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.c | 1 | ||||
-rw-r--r-- | apps/settings.h | 8 | ||||
-rw-r--r-- | apps/settings_menu.c | 25 |
3 files changed, 32 insertions, 2 deletions
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) { | |||
831 | global_settings.backlight_timeout = DEFAULT_BACKLIGHT_TIMEOUT_SETTING; | 831 | global_settings.backlight_timeout = DEFAULT_BACKLIGHT_TIMEOUT_SETTING; |
832 | global_settings.backlight_on_when_charging = | 832 | global_settings.backlight_on_when_charging = |
833 | DEFAULT_BACKLIGHT_ON_WHEN_CHARGING_SETTING; | 833 | DEFAULT_BACKLIGHT_ON_WHEN_CHARGING_SETTING; |
834 | global_settings.battery_capacity = 0; /* 1500 mAh */ | ||
834 | global_settings.trickle_charge = true; | 835 | global_settings.trickle_charge = true; |
835 | global_settings.dirfilter = SHOW_MUSIC; | 836 | global_settings.dirfilter = SHOW_MUSIC; |
836 | global_settings.sort_case = false; | 837 | 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 | |||
85 | bool backlight_on_when_charging; | 85 | bool backlight_on_when_charging; |
86 | bool discharge; /* maintain charge of at least: false = 85%, true = 10% */ | 86 | bool discharge; /* maintain charge of at least: false = 85%, true = 10% */ |
87 | bool trickle_charge; /* do trickle charging: 0=off, 1=on */ | 87 | bool trickle_charge; /* do trickle charging: 0=off, 1=on */ |
88 | int battery_capacity; /* 0 = 1500 mAh | ||
89 | 1 = 1600 mAh | ||
90 | 2 = 1700 mAh | ||
91 | 3 = 1800 mAh | ||
92 | 4 = 1900 mAh | ||
93 | 5 = 2000 mAh | ||
94 | 6 = 2100 mAh | ||
95 | 7 = 2200 mAh */ | ||
88 | 96 | ||
89 | /* resume settings */ | 97 | /* resume settings */ |
90 | 98 | ||
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) | |||
428 | } | 428 | } |
429 | #endif | 429 | #endif |
430 | 430 | ||
431 | /** | ||
432 | * Menu to set the battery capacity | ||
433 | */ | ||
434 | static bool battery_capacity(void) { | ||
435 | bool retval = false; | ||
436 | |||
437 | char* names[] = { "1500 mAh ", "1600 mAh ", | ||
438 | "1700 mAh ", "1800 mAh ", | ||
439 | "1900 mAh ", "2000 mAh ", | ||
440 | "2100 mAh ", "2200 mAh " | ||
441 | }; | ||
442 | |||
443 | retval = set_option( str(LANG_BATTERY_CAPACITY), | ||
444 | &global_settings.battery_capacity, names, 8, NULL); | ||
445 | |||
446 | set_battery_capacity(global_settings.battery_capacity); | ||
447 | |||
448 | return retval; | ||
449 | } | ||
450 | |||
431 | #ifdef HAVE_CHARGE_CTRL | 451 | #ifdef HAVE_CHARGE_CTRL |
432 | static bool deep_discharge(void) | 452 | static bool deep_discharge(void) |
433 | { | 453 | { |
@@ -720,9 +740,10 @@ static bool system_settings_menu(void) | |||
720 | #ifdef HAVE_ATA_POWER_OFF | 740 | #ifdef HAVE_ATA_POWER_OFF |
721 | { str(LANG_POWEROFF), poweroff }, | 741 | { str(LANG_POWEROFF), poweroff }, |
722 | #endif | 742 | #endif |
743 | { str(LANG_BATTERY_CAPACITY), battery_capacity }, | ||
723 | #ifdef HAVE_CHARGE_CTRL | 744 | #ifdef HAVE_CHARGE_CTRL |
724 | { str(LANG_DISCHARGE), deep_discharge }, | 745 | { str(LANG_DISCHARGE), deep_discharge }, |
725 | { str(LANG_TRICKLE_CHARGE), trickle_charge }, | 746 | { str(LANG_TRICKLE_CHARGE), trickle_charge }, |
726 | #endif | 747 | #endif |
727 | #ifdef HAVE_LCD_BITMAP | 748 | #ifdef HAVE_LCD_BITMAP |
728 | { str(LANG_TIME), timedate_set }, | 749 | { str(LANG_TIME), timedate_set }, |