From 72f75f36a5a52c7bee8773feefc2cad7213cc442 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Wed, 12 Mar 2003 15:30:59 +0000 Subject: Removed CPU Sleep setting. It's now permanently enabled. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3434 a1c6a512-1295-4272-9138-f99709370657 --- apps/lang/english.lang | 4 ++-- apps/settings.c | 9 ++------- apps/settings.h | 1 - apps/settings_menu.c | 8 -------- firmware/export/thread.h | 1 - firmware/thread.c | 8 +------- 6 files changed, 5 insertions(+), 26 deletions(-) diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 35f71b903c..9e52a321b9 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -1381,8 +1381,8 @@ eng: "Size:" new: id: LANG_CPU_SLEEP -desc: in system_settings_menu() -eng: "Power Saving" +desc: in system_settings_menu() (removed) +eng: "" new: id: LANG_SETTINGS_LOADED1 diff --git a/apps/settings.c b/apps/settings.c index ea88a058e8..9676f497d6 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -105,7 +105,7 @@ offset abs 0x23 0x37 0x24 0x38 0x25 0x39 + Trickle charge flag (bit 4)> 0x26 0x40 0x27 0x41 0x28 0x42 @@ -357,8 +357,7 @@ 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.cpu_sleep & 1) << 5)); + ((global_settings.trickle_charge & 1) << 4)); { static long lasttime = 0; @@ -522,8 +521,6 @@ void settings_apply(void) global_settings.lang_file); lang_load(buf); } - - cpu_sleep(global_settings.cpu_sleep); } /* @@ -649,7 +646,6 @@ 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) @@ -1509,7 +1505,6 @@ void settings_reset(void) { global_settings.lang_file[0] = 0; global_settings.runtime = 0; global_settings.topruntime = 0; - global_settings.cpu_sleep = true; global_settings.fade_on_stop = true; } diff --git a/apps/settings.h b/apps/settings.h index afc4794e7f..9f5f233a90 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -149,7 +149,6 @@ struct user_settings int scroll_delay; /* delay (in 1/10s) before starting scroll */ int scroll_step; /* pixels to advance per update */ - bool cpu_sleep; /* Use sleep instruction when idle? */ bool fade_on_stop; /* fade on pause/unpause/stop */ }; diff --git a/apps/settings_menu.c b/apps/settings_menu.c index a8487c5c54..c4d8c02c91 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -548,13 +548,6 @@ static bool poweroff(void) } #endif -static bool cpu_sleep_set(void) -{ - bool result = set_bool(str(LANG_CPU_SLEEP), &global_settings.cpu_sleep); - cpu_sleep(global_settings.cpu_sleep); - return result; -} - static bool buffer_margin(void) { return set_int(str(LANG_MP3BUFFER_MARGIN), "s", @@ -755,7 +748,6 @@ static bool system_settings_menu(void) #ifdef HAVE_ATA_POWER_OFF { str(LANG_POWEROFF), poweroff }, #endif - { str(LANG_CPU_SLEEP), cpu_sleep_set }, #ifndef SIMULATOR { str(LANG_BATTERY_CAPACITY), battery_capacity }, #endif diff --git a/firmware/export/thread.h b/firmware/export/thread.h index f5a4b50ddd..c6b3c8e4e3 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h @@ -30,6 +30,5 @@ void sleep_thread(void); void wake_up_thread(void); void init_threads(void); int thread_stack_usage(int threadnum); -void cpu_sleep(bool enabled); #endif diff --git a/firmware/thread.c b/firmware/thread.c index ea518ca4ee..aedd665d2e 100644 --- a/firmware/thread.c +++ b/firmware/thread.c @@ -33,7 +33,6 @@ struct regs }; int num_threads; -bool cpu_sleep_enabled; static volatile int num_sleepers; static int current_thread; static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata"))); @@ -104,7 +103,7 @@ void switch_thread(void) /* Do nothing */ #else - while (cpu_sleep_enabled && num_sleepers == num_threads) + while (num_sleepers == num_threads) { /* Enter sleep mode, woken up on interrupt */ SBYCR &= 0x7F; @@ -125,11 +124,6 @@ void switch_thread(void) panicf("Stkov %s", thread_name[next]); } -void cpu_sleep(bool enabled) -{ - cpu_sleep_enabled = enabled; -} - void sleep_thread(void) { ++num_sleepers; -- cgit v1.2.3