diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-03-12 15:30:59 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-03-12 15:30:59 +0000 |
commit | 72f75f36a5a52c7bee8773feefc2cad7213cc442 (patch) | |
tree | 5767e83cfa0353acf12a54a4bb7675cb37c5c5e0 | |
parent | 3ca8d3589e9bdb260984f90d7e2109a27ca8449c (diff) | |
download | rockbox-72f75f36a5a52c7bee8773feefc2cad7213cc442.tar.gz rockbox-72f75f36a5a52c7bee8773feefc2cad7213cc442.zip |
Removed CPU Sleep setting. It's now permanently enabled.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3434 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/lang/english.lang | 4 | ||||
-rw-r--r-- | apps/settings.c | 9 | ||||
-rw-r--r-- | apps/settings.h | 1 | ||||
-rw-r--r-- | apps/settings_menu.c | 8 | ||||
-rw-r--r-- | firmware/export/thread.h | 1 | ||||
-rw-r--r-- | 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:" | |||
1381 | new: | 1381 | new: |
1382 | 1382 | ||
1383 | id: LANG_CPU_SLEEP | 1383 | id: LANG_CPU_SLEEP |
1384 | desc: in system_settings_menu() | 1384 | desc: in system_settings_menu() (removed) |
1385 | eng: "Power Saving" | 1385 | eng: "" |
1386 | new: | 1386 | new: |
1387 | 1387 | ||
1388 | id: LANG_SETTINGS_LOADED1 | 1388 | 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 | |||
105 | 0x23 0x37 <rec. left gain (bit 0-3)> | 105 | 0x23 0x37 <rec. left gain (bit 0-3)> |
106 | 0x24 0x38 <rec. right gain (bit 0-3)> | 106 | 0x24 0x38 <rec. right gain (bit 0-3)> |
107 | 0x25 0x39 <disk poweroff flag (bit 0), MP3 buffer margin (bit 1-3), | 107 | 0x25 0x39 <disk poweroff flag (bit 0), MP3 buffer margin (bit 1-3), |
108 | Trickle charge flag (bit 4), CPU sleep flag (bit 5)> | 108 | Trickle charge flag (bit 4)> |
109 | 0x26 0x40 <runtime low byte> | 109 | 0x26 0x40 <runtime low byte> |
110 | 0x27 0x41 <runtime high byte> | 110 | 0x27 0x41 <runtime high byte> |
111 | 0x28 0x42 <topruntime low byte> | 111 | 0x28 0x42 <topruntime low byte> |
@@ -357,8 +357,7 @@ int settings_save( void ) | |||
357 | config_block[0x25] = (unsigned char) | 357 | config_block[0x25] = (unsigned char) |
358 | ((global_settings.disk_poweroff & 1) | | 358 | ((global_settings.disk_poweroff & 1) | |
359 | ((global_settings.buffer_margin & 7) << 1) | | 359 | ((global_settings.buffer_margin & 7) << 1) | |
360 | ((global_settings.trickle_charge & 1) << 4) | | 360 | ((global_settings.trickle_charge & 1) << 4)); |
361 | ((global_settings.cpu_sleep & 1) << 5)); | ||
362 | 361 | ||
363 | { | 362 | { |
364 | static long lasttime = 0; | 363 | static long lasttime = 0; |
@@ -522,8 +521,6 @@ void settings_apply(void) | |||
522 | global_settings.lang_file); | 521 | global_settings.lang_file); |
523 | lang_load(buf); | 522 | lang_load(buf); |
524 | } | 523 | } |
525 | |||
526 | cpu_sleep(global_settings.cpu_sleep); | ||
527 | } | 524 | } |
528 | 525 | ||
529 | /* | 526 | /* |
@@ -649,7 +646,6 @@ void settings_load(void) | |||
649 | global_settings.disk_poweroff = config_block[0x25] & 1; | 646 | global_settings.disk_poweroff = config_block[0x25] & 1; |
650 | global_settings.buffer_margin = (config_block[0x25] >> 1) & 7; | 647 | global_settings.buffer_margin = (config_block[0x25] >> 1) & 7; |
651 | global_settings.trickle_charge = (config_block[0x25] >> 4) & 1; | 648 | global_settings.trickle_charge = (config_block[0x25] >> 4) & 1; |
652 | global_settings.cpu_sleep = (config_block[0x25] >> 5) & 1; | ||
653 | } | 649 | } |
654 | 650 | ||
655 | if (config_block[0x27] != 0xff) | 651 | if (config_block[0x27] != 0xff) |
@@ -1509,7 +1505,6 @@ void settings_reset(void) { | |||
1509 | global_settings.lang_file[0] = 0; | 1505 | global_settings.lang_file[0] = 0; |
1510 | global_settings.runtime = 0; | 1506 | global_settings.runtime = 0; |
1511 | global_settings.topruntime = 0; | 1507 | global_settings.topruntime = 0; |
1512 | global_settings.cpu_sleep = true; | ||
1513 | global_settings.fade_on_stop = true; | 1508 | global_settings.fade_on_stop = true; |
1514 | } | 1509 | } |
1515 | 1510 | ||
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 | |||
149 | int scroll_delay; /* delay (in 1/10s) before starting scroll */ | 149 | int scroll_delay; /* delay (in 1/10s) before starting scroll */ |
150 | int scroll_step; /* pixels to advance per update */ | 150 | int scroll_step; /* pixels to advance per update */ |
151 | 151 | ||
152 | bool cpu_sleep; /* Use sleep instruction when idle? */ | ||
153 | bool fade_on_stop; /* fade on pause/unpause/stop */ | 152 | bool fade_on_stop; /* fade on pause/unpause/stop */ |
154 | }; | 153 | }; |
155 | 154 | ||
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) | |||
548 | } | 548 | } |
549 | #endif | 549 | #endif |
550 | 550 | ||
551 | static bool cpu_sleep_set(void) | ||
552 | { | ||
553 | bool result = set_bool(str(LANG_CPU_SLEEP), &global_settings.cpu_sleep); | ||
554 | cpu_sleep(global_settings.cpu_sleep); | ||
555 | return result; | ||
556 | } | ||
557 | |||
558 | static bool buffer_margin(void) | 551 | static bool buffer_margin(void) |
559 | { | 552 | { |
560 | return set_int(str(LANG_MP3BUFFER_MARGIN), "s", | 553 | return set_int(str(LANG_MP3BUFFER_MARGIN), "s", |
@@ -755,7 +748,6 @@ static bool system_settings_menu(void) | |||
755 | #ifdef HAVE_ATA_POWER_OFF | 748 | #ifdef HAVE_ATA_POWER_OFF |
756 | { str(LANG_POWEROFF), poweroff }, | 749 | { str(LANG_POWEROFF), poweroff }, |
757 | #endif | 750 | #endif |
758 | { str(LANG_CPU_SLEEP), cpu_sleep_set }, | ||
759 | #ifndef SIMULATOR | 751 | #ifndef SIMULATOR |
760 | { str(LANG_BATTERY_CAPACITY), battery_capacity }, | 752 | { str(LANG_BATTERY_CAPACITY), battery_capacity }, |
761 | #endif | 753 | #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); | |||
30 | void wake_up_thread(void); | 30 | void wake_up_thread(void); |
31 | void init_threads(void); | 31 | void init_threads(void); |
32 | int thread_stack_usage(int threadnum); | 32 | int thread_stack_usage(int threadnum); |
33 | void cpu_sleep(bool enabled); | ||
34 | 33 | ||
35 | #endif | 34 | #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 | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | int num_threads; | 35 | int num_threads; |
36 | bool cpu_sleep_enabled; | ||
37 | static volatile int num_sleepers; | 36 | static volatile int num_sleepers; |
38 | static int current_thread; | 37 | static int current_thread; |
39 | static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata"))); | 38 | static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata"))); |
@@ -104,7 +103,7 @@ void switch_thread(void) | |||
104 | /* Do nothing */ | 103 | /* Do nothing */ |
105 | #else | 104 | #else |
106 | 105 | ||
107 | while (cpu_sleep_enabled && num_sleepers == num_threads) | 106 | while (num_sleepers == num_threads) |
108 | { | 107 | { |
109 | /* Enter sleep mode, woken up on interrupt */ | 108 | /* Enter sleep mode, woken up on interrupt */ |
110 | SBYCR &= 0x7F; | 109 | SBYCR &= 0x7F; |
@@ -125,11 +124,6 @@ void switch_thread(void) | |||
125 | panicf("Stkov %s", thread_name[next]); | 124 | panicf("Stkov %s", thread_name[next]); |
126 | } | 125 | } |
127 | 126 | ||
128 | void cpu_sleep(bool enabled) | ||
129 | { | ||
130 | cpu_sleep_enabled = enabled; | ||
131 | } | ||
132 | |||
133 | void sleep_thread(void) | 127 | void sleep_thread(void) |
134 | { | 128 | { |
135 | ++num_sleepers; | 129 | ++num_sleepers; |