From 8125f16f1d46baa9c11426e7f33b83b28a8c8700 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sun, 15 Dec 2002 00:33:13 +0000 Subject: Made trickle charge persistent git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2999 a1c6a512-1295-4272-9138-f99709370657 --- apps/settings.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'apps/settings.c') diff --git a/apps/settings.c b/apps/settings.c index 8f3bbbce34..e854f6207d 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -105,7 +105,8 @@ offset abs 0x22 0x36 0x23 0x37 0x24 0x38 -0x25 0x39 +0x25 0x39 0x26 0x40 0x27 0x41 0x28 0x42 @@ -349,7 +350,8 @@ int settings_save( void ) config_block[0x24] = (unsigned char)global_settings.rec_right_gain; config_block[0x25] = (unsigned char) ((global_settings.disk_poweroff & 1) | - ((global_settings.buffer_margin & 7) << 1)); + ((global_settings.buffer_margin & 7) << 1) | + ((global_settings.trickle_charge & 1) << 4)); { static long lasttime = 0; @@ -461,6 +463,7 @@ void settings_apply(void) #ifdef HAVE_CHARGE_CTRL charge_restart_level = global_settings.discharge ? CHARGE_RESTART_LO : CHARGE_RESTART_HI; + enable_trickle_charge(global_settings.trickle_charge); #endif #ifdef HAVE_LCD_BITMAP @@ -500,8 +503,6 @@ void settings_apply(void) global_settings.lang_file); lang_load(buf); } - - } /* @@ -636,6 +637,7 @@ void settings_load(void) { global_settings.disk_poweroff = config_block[0x25] & 1; global_settings.buffer_margin = (config_block[0x25] >> 1) & 7; + global_settings.trickle_charge = (config_block[0x25] >> 4) & 1; } if (config_block[0x27] != 0xff) @@ -829,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.trickle_charge = true; global_settings.dirfilter = SHOW_MUSIC; global_settings.sort_case = false; global_settings.statusbar = true; -- cgit v1.2.3