summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/settings.c8
-rw-r--r--apps/settings.h4
-rw-r--r--apps/settings_menu.c11
-rw-r--r--apps/tree.c4
-rw-r--r--apps/wps.c3
5 files changed, 26 insertions, 4 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 11a4647447..441abb585d 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -268,7 +268,8 @@ int settings_save( void )
268 268
269 config_block[0x10] = (unsigned char)global_settings.ff_rewind; 269 config_block[0x10] = (unsigned char)global_settings.ff_rewind;
270 config_block[0x11] = (unsigned char)global_settings.avc; 270 config_block[0x11] = (unsigned char)global_settings.avc;
271 271 config_block[0x1a] = (unsigned char)global_settings.disk_spindown;
272
272 memcpy(&config_block[0x12], &global_settings.resume_index, 4); 273 memcpy(&config_block[0x12], &global_settings.resume_index, 4);
273 memcpy(&config_block[0x16], &global_settings.resume_offset, 4); 274 memcpy(&config_block[0x16], &global_settings.resume_offset, 4);
274 memcpy(&config_block[0xF8], &global_settings.resume_seed, 4); 275 memcpy(&config_block[0xF8], &global_settings.resume_seed, 4);
@@ -369,6 +370,9 @@ void settings_load(void)
369 if (config_block[0x16] != 0xFF) 370 if (config_block[0x16] != 0xFF)
370 memcpy(&global_settings.resume_offset, &config_block[0x16], 4); 371 memcpy(&global_settings.resume_offset, &config_block[0x16], 4);
371 372
373 if (config_block[0x1a] != 0xFF)
374 global_settings.disk_spindown = config_block[0x1a];
375
372 memcpy(&global_settings.resume_seed, &config_block[0xF8], 4); 376 memcpy(&global_settings.resume_seed, &config_block[0xF8], 4);
373 377
374 if (config_block[0x24] != 0xFF) 378 if (config_block[0x24] != 0xFF)
@@ -380,6 +384,7 @@ void settings_load(void)
380 lcd_set_contrast(global_settings.contrast); 384 lcd_set_contrast(global_settings.contrast);
381 lcd_scroll_speed(global_settings.scroll_speed); 385 lcd_scroll_speed(global_settings.scroll_speed);
382 backlight_time(global_settings.backlight); 386 backlight_time(global_settings.backlight);
387 ata_spindown(global_settings.disk_spindown);
383#ifdef HAVE_CHARGE_CTRL 388#ifdef HAVE_CHARGE_CTRL
384 charge_restart_level = global_settings.discharge ? CHARGE_RESTART_LO : CHARGE_RESTART_HI; 389 charge_restart_level = global_settings.discharge ? CHARGE_RESTART_LO : CHARGE_RESTART_HI;
385#endif 390#endif
@@ -416,6 +421,7 @@ void settings_reset(void) {
416 global_settings.ff_rewind = DEFAULT_FF_REWIND_SETTING; 421 global_settings.ff_rewind = DEFAULT_FF_REWIND_SETTING;
417 global_settings.resume_index = -1; 422 global_settings.resume_index = -1;
418 global_settings.resume_offset = -1; 423 global_settings.resume_offset = -1;
424 global_settings.disk_spindown = 5;
419} 425}
420 426
421 427
diff --git a/apps/settings.h b/apps/settings.h
index 36cf4930e1..91ffb3ed90 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -63,6 +63,8 @@ struct user_settings
63 bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ 63 bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */
64 int scroll_speed; /* long texts scrolling speed: 1-20 */ 64 int scroll_speed; /* long texts scrolling speed: 1-20 */
65 bool playlist_shuffle; 65 bool playlist_shuffle;
66 int ff_rewind; /* FF/Rewind step size (in seconds) */
67 int disk_spindown; /* time until disk spindown, in seconds (0=off) */
66 68
67 /* while playing screen settings */ 69 /* while playing screen settings */
68 int wps_display; /* 0=id3, 1=file, 2=parse */ 70 int wps_display; /* 0=id3, 1=file, 2=parse */
@@ -77,8 +79,6 @@ struct user_settings
77 /* geeky persistent statistics */ 79 /* geeky persistent statistics */
78 unsigned int total_uptime; /* total uptime since rockbox was first booted */ 80 unsigned int total_uptime; /* total uptime since rockbox was first booted */
79 81
80 /* FF/Rewind step size (in seconds) */
81 int ff_rewind;
82}; 82};
83 83
84/* prototypes */ 84/* prototypes */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index c3f3bccb61..9f36d3be2b 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -35,6 +35,7 @@
35#include "fat.h" /* For dotfile settings */ 35#include "fat.h" /* For dotfile settings */
36#include "powermgmt.h" 36#include "powermgmt.h"
37#include "rtc.h" 37#include "rtc.h"
38#include "ata.h"
38 39
39static Menu show_hidden_files(void) 40static Menu show_hidden_files(void)
40{ 41{
@@ -167,7 +168,14 @@ static Menu timedate_set(void)
167static Menu ff_rewind(void) 168static Menu ff_rewind(void)
168{ 169{
169 set_int("[FF/Rewind Step Size]", "s", &global_settings.ff_rewind, 170 set_int("[FF/Rewind Step Size]", "s", &global_settings.ff_rewind,
170 NULL, 1, 1, 255 ); 171 NULL, 1, 1, 254 );
172 return MENU_OK;
173}
174
175static Menu spindown(void)
176{
177 set_int("[Disk spindown]", "s", &global_settings.disk_spindown,
178 ata_spindown, 1, 1, 254 );
171 return MENU_OK; 179 return MENU_OK;
172} 180}
173 181
@@ -193,6 +201,7 @@ Menu settings_menu(void)
193 { "Show hidden files", show_hidden_files }, 201 { "Show hidden files", show_hidden_files },
194 { "FF/Rewind", ff_rewind }, 202 { "FF/Rewind", ff_rewind },
195 { "Resume", resume }, 203 { "Resume", resume },
204 { "Disk spindown", spindown },
196 }; 205 };
197 bool old_shuffle = global_settings.playlist_shuffle; 206 bool old_shuffle = global_settings.playlist_shuffle;
198 207
diff --git a/apps/tree.c b/apps/tree.c
index 9dae3229e2..e47452fe54 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -39,6 +39,7 @@
39#include "settings.h" 39#include "settings.h"
40#include "status.h" 40#include "status.h"
41#include "debug.h" 41#include "debug.h"
42#include "ata.h"
42 43
43#ifdef HAVE_LCD_BITMAP 44#ifdef HAVE_LCD_BITMAP
44#include "icons.h" 45#include "icons.h"
@@ -718,6 +719,9 @@ bool dirbrowse(char *root)
718#endif 719#endif
719 } 720 }
720 721
722 if ( button )
723 ata_spin();
724
721 if ( restore ) { 725 if ( restore ) {
722 /* restore display */ 726 /* restore display */
723 /* We need to adjust if the number of lines on screen have 727 /* We need to adjust if the number of lines on screen have
diff --git a/apps/wps.c b/apps/wps.c
index bdad325434..571b35675d 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -1185,6 +1185,9 @@ int wps_show(void)
1185 break; 1185 break;
1186 } 1186 }
1187 1187
1188 if ( button )
1189 ata_spin();
1190
1188 if(restore) { 1191 if(restore) {
1189 restore = false; 1192 restore = false;
1190 draw_screen(id3); 1193 draw_screen(id3);