summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang4
-rw-r--r--apps/settings.c7
-rw-r--r--apps/settings.h1
-rw-r--r--apps/settings_menu.c8
4 files changed, 19 insertions, 1 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index b71dca0efc..0469cdc317 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -1152,3 +1152,7 @@ desc: disk size info
1152eng: "Free: %d.%dGB" 1152eng: "Free: %d.%dGB"
1153new: 1153new:
1154 1154
1155id: LANG_POWEROFF
1156desc: disk poweroff flag
1157eng: "Disk Poweroff"
1158new:
diff --git a/apps/settings.c b/apps/settings.c
index 328061d6ef..f61db32b56 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -104,7 +104,7 @@ offset abs
1040x22 0x36 <rec. quality (bit 0-2), source (bit 3-4), frequency (bit 5-7)> 1040x22 0x36 <rec. quality (bit 0-2), source (bit 3-4), frequency (bit 5-7)>
1050x23 0x37 <rec. left gain (bit 0-3)> 1050x23 0x37 <rec. left gain (bit 0-3)>
1060x24 0x38 <rec. right gain (bit 0-3)> 1060x24 0x38 <rec. right gain (bit 0-3)>
107 1070x25 0x39 <disk_spindown flag>
108 108
109 <all unused space filled with 0xff> 109 <all unused space filled with 0xff>
110 110
@@ -341,6 +341,7 @@ int settings_save( void )
341 ((global_settings.rec_frequency & 7) << 5)); 341 ((global_settings.rec_frequency & 7) << 5));
342 config_block[0x23] = (unsigned char)global_settings.rec_left_gain; 342 config_block[0x23] = (unsigned char)global_settings.rec_left_gain;
343 config_block[0x24] = (unsigned char)global_settings.rec_right_gain; 343 config_block[0x24] = (unsigned char)global_settings.rec_right_gain;
344 config_block[0x25] = (unsigned char)global_settings.disk_poweroff & 1;
344 345
345 strncpy(&config_block[0xb8], global_settings.wps_file, MAX_FILENAME); 346 strncpy(&config_block[0xb8], global_settings.wps_file, MAX_FILENAME);
346 strncpy(&config_block[0xcc], global_settings.lang_file, MAX_FILENAME); 347 strncpy(&config_block[0xcc], global_settings.lang_file, MAX_FILENAME);
@@ -593,6 +594,9 @@ void settings_load(void)
593 if (config_block[0x24] != 0xFF) 594 if (config_block[0x24] != 0xFF)
594 global_settings.rec_right_gain = config_block[0x24] & 0x0f; 595 global_settings.rec_right_gain = config_block[0x24] & 0x0f;
595 596
597 if (config_block[0x25] != 0xFF)
598 global_settings.disk_poweroff = config_block[0x25] & 1;
599
596 memcpy(&global_settings.resume_first_index, &config_block[0xF4], 4); 600 memcpy(&global_settings.resume_first_index, &config_block[0xF4], 4);
597 memcpy(&global_settings.resume_seed, &config_block[0xF8], 4); 601 memcpy(&global_settings.resume_seed, &config_block[0xF8], 4);
598 602
@@ -783,6 +787,7 @@ void settings_reset(void) {
783 global_settings.resume_index = -1; 787 global_settings.resume_index = -1;
784 global_settings.resume_offset = -1; 788 global_settings.resume_offset = -1;
785 global_settings.disk_spindown = 5; 789 global_settings.disk_spindown = 5;
790 global_settings.disk_poweroff = false;
786 global_settings.browse_current = false; 791 global_settings.browse_current = false;
787 global_settings.play_selected = true; 792 global_settings.play_selected = true;
788 global_settings.peak_meter_release = 8; 793 global_settings.peak_meter_release = 8;
diff --git a/apps/settings.h b/apps/settings.h
index 2622d314f7..69f56ec870 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -111,6 +111,7 @@ struct user_settings
111 int ff_rewind_min_step; /* FF/Rewind minimum step size */ 111 int ff_rewind_min_step; /* FF/Rewind minimum step size */
112 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */ 112 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */
113 int disk_spindown; /* time until disk spindown, in seconds (0=off) */ 113 int disk_spindown; /* time until disk spindown, in seconds (0=off) */
114 bool disk_poweroff; /* whether to cut disk power after spindown or not */
114 115
115 int peak_meter_release; /* units per read out */ 116 int peak_meter_release; /* units per read out */
116 int peak_meter_hold; /* hold time for peak meter in 1/100 s */ 117 int peak_meter_hold; /* hold time for peak meter in 1/100 s */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index ed2f97e390..7db91c3ca8 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -486,6 +486,13 @@ static bool spindown(void)
486 ata_spindown, 1, 3, 254 ); 486 ata_spindown, 1, 3, 254 );
487} 487}
488 488
489static bool poweroff(void)
490{
491 bool rc = set_bool(str(LANG_POWEROFF), &global_settings.disk_poweroff);
492 ata_poweroff(global_settings.disk_poweroff);
493 return rc;
494}
495
489static bool ff_rewind_min_step(void) 496static bool ff_rewind_min_step(void)
490{ 497{
491 char* names[] = { "1s", "2s", "3s", "4s", 498 char* names[] = { "1s", "2s", "3s", "4s",
@@ -642,6 +649,7 @@ static bool system_settings_menu(void)
642 649
643 struct menu_items items[] = { 650 struct menu_items items[] = {
644 { str(LANG_SPINDOWN), spindown }, 651 { str(LANG_SPINDOWN), spindown },
652 { str(LANG_POWEROFF), poweroff },
645#ifdef HAVE_CHARGE_CTRL 653#ifdef HAVE_CHARGE_CTRL
646 { str(LANG_DISCHARGE), deep_discharge }, 654 { str(LANG_DISCHARGE), deep_discharge },
647#endif 655#endif