summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/settings.c18
-rw-r--r--apps/settings_menu.c3
2 files changed, 16 insertions, 5 deletions
diff --git a/apps/settings.c b/apps/settings.c
index b8062be68a..bc5a5bc7b4 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -49,6 +49,7 @@
49#include "icons.h" 49#include "icons.h"
50#include "font.h" 50#include "font.h"
51#include "peakmeter.h" 51#include "peakmeter.h"
52#include "hwcompat.h"
52#endif 53#endif
53#include "lang.h" 54#include "lang.h"
54#include "language.h" 55#include "language.h"
@@ -61,7 +62,7 @@
61struct user_settings global_settings; 62struct user_settings global_settings;
62char rockboxdir[] = ROCKBOX_DIR; /* config/font/data file directory */ 63char rockboxdir[] = ROCKBOX_DIR; /* config/font/data file directory */
63 64
64#define CONFIG_BLOCK_VERSION 5 65#define CONFIG_BLOCK_VERSION 6
65#define CONFIG_BLOCK_SIZE 512 66#define CONFIG_BLOCK_SIZE 512
66#define RTC_BLOCK_SIZE 44 67#define RTC_BLOCK_SIZE 44
67 68
@@ -549,6 +550,15 @@ void settings_apply(void)
549 } 550 }
550} 551}
551 552
553static int default_contrast(void)
554{
555#ifdef HAVE_LCD_CHARCELLS
556 return 30;
557#else
558 return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49;
559#endif
560}
561
552/* 562/*
553 * load settings from disk or RTC RAM 563 * load settings from disk or RTC RAM
554 */ 564 */
@@ -581,7 +591,7 @@ void settings_load(void)
581 global_settings.invert = 591 global_settings.invert =
582 config_block[0xa] & 0x40 ? true : false; 592 config_block[0xa] & 0x40 ? true : false;
583 if ( global_settings.contrast < MIN_CONTRAST_SETTING ) 593 if ( global_settings.contrast < MIN_CONTRAST_SETTING )
584 global_settings.contrast = DEFAULT_CONTRAST_SETTING; 594 global_settings.contrast = default_contrast();
585 global_settings.show_icons = 595 global_settings.show_icons =
586 config_block[0xa] & 0x80 ? true : false; 596 config_block[0xa] & 0x80 ? true : false;
587 } 597 }
@@ -989,7 +999,7 @@ bool settings_load_config(char* file)
989 set_cfg_bool(&global_settings.play_selected, value); 999 set_cfg_bool(&global_settings.play_selected, value);
990 else if (!strcasecmp(name, "contrast")) 1000 else if (!strcasecmp(name, "contrast"))
991 set_cfg_int(&global_settings.contrast, value, 1001 set_cfg_int(&global_settings.contrast, value,
992 0, MAX_CONTRAST_SETTING); 1002 MIN_CONTRAST_SETTING, MAX_CONTRAST_SETTING);
993 else if (!strcasecmp(name, "scroll speed")) 1003 else if (!strcasecmp(name, "scroll speed"))
994 set_cfg_int(&global_settings.scroll_speed, value, 1, 10); 1004 set_cfg_int(&global_settings.scroll_speed, value, 1, 10);
995 else if (!strcasecmp(name, "scan min step")) { 1005 else if (!strcasecmp(name, "scan min step")) {
@@ -1405,7 +1415,7 @@ void settings_reset(void) {
1405 global_settings.rec_right_gain = 2; /* 0dB */ 1415 global_settings.rec_right_gain = 2; /* 0dB */
1406 global_settings.rec_editable = false; 1416 global_settings.rec_editable = false;
1407 global_settings.resume = RESUME_ASK; 1417 global_settings.resume = RESUME_ASK;
1408 global_settings.contrast = DEFAULT_CONTRAST_SETTING; 1418 global_settings.contrast = default_contrast();
1409 global_settings.invert = DEFAULT_INVERT_SETTING; 1419 global_settings.invert = DEFAULT_INVERT_SETTING;
1410 global_settings.poweroff = DEFAULT_POWEROFF_SETTING; 1420 global_settings.poweroff = DEFAULT_POWEROFF_SETTING;
1411 global_settings.backlight_timeout = DEFAULT_BACKLIGHT_TIMEOUT_SETTING; 1421 global_settings.backlight_timeout = DEFAULT_BACKLIGHT_TIMEOUT_SETTING;
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index e51b3f32fd..57ba18132a 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -46,7 +46,8 @@
46static bool contrast(void) 46static bool contrast(void)
47{ 47{
48 return set_int( str(LANG_CONTRAST), "", &global_settings.contrast, 48 return set_int( str(LANG_CONTRAST), "", &global_settings.contrast,
49 lcd_set_contrast, 1, 0, MAX_CONTRAST_SETTING ); 49 lcd_set_contrast, 1, MIN_CONTRAST_SETTING,
50 MAX_CONTRAST_SETTING );
50} 51}
51 52
52static bool caption_backlight(void) 53static bool caption_backlight(void)