summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 31d4f1a82b..1b4f864ec5 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -53,6 +53,12 @@ char rockboxdir[] = ROCKBOX_DIR; /* config/font/data file directory */
53#define CONFIG_BLOCK_SIZE 512 53#define CONFIG_BLOCK_SIZE 512
54#define RTC_BLOCK_SIZE 44 54#define RTC_BLOCK_SIZE 44
55 55
56#ifdef HAVE_LCD_BITMAP
57#define MAX_LINES 10
58#else
59#define MAX_LINES 2
60#endif
61
56/******************************************** 62/********************************************
57 63
58Config block as saved on the battery-packed RTC user RAM memory block 64Config block as saved on the battery-packed RTC user RAM memory block
@@ -80,6 +86,9 @@ offset abs
800x16 0x2a <(int) Byte offset into resume file> 860x16 0x2a <(int) Byte offset into resume file>
810x1a 0x2e <time until disk spindown> 870x1a 0x2e <time until disk spindown>
820x1b 0x2f <browse current, play selected> 880x1b 0x2f <browse current, play selected>
890x1c 0x30 <peak meter hold timeout (bit 0-4)>
900x1d 0x31 <peak meter clip hold timeout (bit 0-4)>
910x1e 0x32 <peak meter release step size>
83 92
84 <all unused space filled with 0xff> 93 <all unused space filled with 0xff>
85 94
@@ -290,6 +299,10 @@ int settings_save( void )
290 (((global_settings.browse_current & 1)) | 299 (((global_settings.browse_current & 1)) |
291 ((global_settings.play_selected & 1) << 1)); 300 ((global_settings.play_selected & 1) << 1));
292 301
302 config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold;
303 config_block[0x1d] = (unsigned char)global_settings.peak_meter_clip_hold;
304 config_block[0x1e] = (unsigned char)global_settings.peak_meter_release;
305
293 memcpy(&config_block[0xF8], &global_settings.resume_seed, 4); 306 memcpy(&config_block[0xF8], &global_settings.resume_seed, 4);
294 307
295 memcpy(&config_block[0x24], &global_settings.total_uptime, 4); 308 memcpy(&config_block[0x24], &global_settings.total_uptime, 4);
@@ -400,6 +413,15 @@ void settings_load(void)
400 global_settings.play_selected = (config_block[0x1b] >> 1) & 1; 413 global_settings.play_selected = (config_block[0x1b] >> 1) & 1;
401 } 414 }
402 415
416 if (config_block[0x1c] != 0xFF)
417 global_settings.peak_meter_hold = (config_block[0x1c]) & 0x1f;
418
419 if (config_block[0x1d] != 0xFF)
420 global_settings.peak_meter_clip_hold = (config_block[0x1d]) & 0x1f;
421
422 if (config_block[0x1e] != 0xFF)
423 global_settings.peak_meter_release = config_block[0x1e];
424
403 memcpy(&global_settings.resume_seed, &config_block[0xF8], 4); 425 memcpy(&global_settings.resume_seed, &config_block[0xF8], 4);
404 426
405 if (config_block[0x24] != 0xFF) 427 if (config_block[0x24] != 0xFF)
@@ -471,7 +493,7 @@ bool settings_load_eq(char* file)
471 break; 493 break;
472 case 3: 494 case 3:
473 snprintf(buf_disp,sizeof(buf_disp),"[%s]%s", buf_set, buf_val); 495 snprintf(buf_disp,sizeof(buf_disp),"[%s]%s", buf_set, buf_val);
474 lcd_puts(0,line++ % 6,buf_disp); 496 lcd_puts(0,line++ % MAX_LINES, buf_disp);
475 lcd_update(); 497 lcd_update();
476 sleep(HZ/2); 498 sleep(HZ/2);
477 if (!strcasecmp(buf_set,"volume")) { 499 if (!strcasecmp(buf_set,"volume")) {
@@ -610,6 +632,9 @@ void settings_reset(void) {
610 global_settings.disk_spindown = 5; 632 global_settings.disk_spindown = 5;
611 global_settings.browse_current = false; 633 global_settings.browse_current = false;
612 global_settings.play_selected = true; 634 global_settings.play_selected = true;
635 global_settings.peak_meter_release = 8;
636 global_settings.peak_meter_hold = 1;
637 global_settings.peak_meter_clip_hold = 16;
613} 638}
614 639
615 640