From c4d8d970f6602c80d7362a41da8851dbbf59ae1b Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Fri, 14 Feb 2003 09:44:34 +0000 Subject: The power-saving SLEEP patch by Simon Elén. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3259 a1c6a512-1295-4272-9138-f99709370657 --- apps/settings.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'apps/settings.c') diff --git a/apps/settings.c b/apps/settings.c index bc78e823dd..c7ab9e411c 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -21,6 +21,7 @@ #include #include "config.h" #include "kernel.h" +#include "thread.h" #include "settings.h" #include "disk.h" #include "panic.h" @@ -102,7 +103,7 @@ offset abs 0x23 0x37 0x24 0x38 0x25 0x39 + Trickle charge flag (bit 4), CPU sleep flag (bit 5)> 0x26 0x40 0x27 0x41 0x28 0x42 @@ -350,7 +351,8 @@ int settings_save( void ) config_block[0x25] = (unsigned char) ((global_settings.disk_poweroff & 1) | ((global_settings.buffer_margin & 7) << 1) | - ((global_settings.trickle_charge & 1) << 4)); + ((global_settings.trickle_charge & 1) << 4) | + ((global_settings.cpu_sleep & 1) << 5)); { static long lasttime = 0; @@ -513,6 +515,8 @@ void settings_apply(void) global_settings.lang_file); lang_load(buf); } + + cpu_sleep(global_settings.cpu_sleep); } /* @@ -636,6 +640,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; + global_settings.cpu_sleep = (config_block[0x25] >> 5) & 1; } if (config_block[0x27] != 0xff) @@ -881,6 +886,7 @@ void settings_reset(void) { global_settings.lang_file[0] = 0; global_settings.runtime = 0; global_settings.topruntime = 0; + global_settings.cpu_sleep = true; } -- cgit v1.2.3