diff options
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 10 |
1 files changed, 8 insertions, 2 deletions
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 @@ | |||
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | #include "config.h" | 22 | #include "config.h" |
23 | #include "kernel.h" | 23 | #include "kernel.h" |
24 | #include "thread.h" | ||
24 | #include "settings.h" | 25 | #include "settings.h" |
25 | #include "disk.h" | 26 | #include "disk.h" |
26 | #include "panic.h" | 27 | #include "panic.h" |
@@ -102,7 +103,7 @@ offset abs | |||
102 | 0x23 0x37 <rec. left gain (bit 0-3)> | 103 | 0x23 0x37 <rec. left gain (bit 0-3)> |
103 | 0x24 0x38 <rec. right gain (bit 0-3)> | 104 | 0x24 0x38 <rec. right gain (bit 0-3)> |
104 | 0x25 0x39 <disk poweroff flag (bit 0), MP3 buffer margin (bit 1-3), | 105 | 0x25 0x39 <disk poweroff flag (bit 0), MP3 buffer margin (bit 1-3), |
105 | Trickle charge flag (bit 4)> | 106 | Trickle charge flag (bit 4), CPU sleep flag (bit 5)> |
106 | 0x26 0x40 <runtime low byte> | 107 | 0x26 0x40 <runtime low byte> |
107 | 0x27 0x41 <runtime high byte> | 108 | 0x27 0x41 <runtime high byte> |
108 | 0x28 0x42 <topruntime low byte> | 109 | 0x28 0x42 <topruntime low byte> |
@@ -350,7 +351,8 @@ int settings_save( void ) | |||
350 | config_block[0x25] = (unsigned char) | 351 | config_block[0x25] = (unsigned char) |
351 | ((global_settings.disk_poweroff & 1) | | 352 | ((global_settings.disk_poweroff & 1) | |
352 | ((global_settings.buffer_margin & 7) << 1) | | 353 | ((global_settings.buffer_margin & 7) << 1) | |
353 | ((global_settings.trickle_charge & 1) << 4)); | 354 | ((global_settings.trickle_charge & 1) << 4) | |
355 | ((global_settings.cpu_sleep & 1) << 5)); | ||
354 | 356 | ||
355 | { | 357 | { |
356 | static long lasttime = 0; | 358 | static long lasttime = 0; |
@@ -513,6 +515,8 @@ void settings_apply(void) | |||
513 | global_settings.lang_file); | 515 | global_settings.lang_file); |
514 | lang_load(buf); | 516 | lang_load(buf); |
515 | } | 517 | } |
518 | |||
519 | cpu_sleep(global_settings.cpu_sleep); | ||
516 | } | 520 | } |
517 | 521 | ||
518 | /* | 522 | /* |
@@ -636,6 +640,7 @@ void settings_load(void) | |||
636 | global_settings.disk_poweroff = config_block[0x25] & 1; | 640 | global_settings.disk_poweroff = config_block[0x25] & 1; |
637 | global_settings.buffer_margin = (config_block[0x25] >> 1) & 7; | 641 | global_settings.buffer_margin = (config_block[0x25] >> 1) & 7; |
638 | global_settings.trickle_charge = (config_block[0x25] >> 4) & 1; | 642 | global_settings.trickle_charge = (config_block[0x25] >> 4) & 1; |
643 | global_settings.cpu_sleep = (config_block[0x25] >> 5) & 1; | ||
639 | } | 644 | } |
640 | 645 | ||
641 | if (config_block[0x27] != 0xff) | 646 | if (config_block[0x27] != 0xff) |
@@ -881,6 +886,7 @@ void settings_reset(void) { | |||
881 | global_settings.lang_file[0] = 0; | 886 | global_settings.lang_file[0] = 0; |
882 | global_settings.runtime = 0; | 887 | global_settings.runtime = 0; |
883 | global_settings.topruntime = 0; | 888 | global_settings.topruntime = 0; |
889 | global_settings.cpu_sleep = true; | ||
884 | } | 890 | } |
885 | 891 | ||
886 | 892 | ||