diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.c | 12 | ||||
-rw-r--r-- | apps/settings.h | 17 | ||||
-rw-r--r-- | apps/settings_menu.c | 4 |
3 files changed, 28 insertions, 5 deletions
diff --git a/apps/settings.c b/apps/settings.c index 4746c22c87..ee7fa36d39 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -302,7 +302,8 @@ static const struct bit_entry rtc_bits[] = | |||
302 | 302 | ||
303 | #ifdef HAVE_REMOTE_LCD | 303 | #ifdef HAVE_REMOTE_LCD |
304 | /* remote lcd */ | 304 | /* remote lcd */ |
305 | {6, S_O(remote_contrast), 42, "remote contrast", NULL }, | 305 | {6, S_O(remote_contrast), DEFAULT_REMOTE_CONTRAST_SETTING, |
306 | "remote contrast", NULL }, | ||
306 | {1, S_O(remote_invert), false, "remote invert", off_on }, | 307 | {1, S_O(remote_invert), false, "remote invert", off_on }, |
307 | {1, S_O(remote_flip_display), false, "remote flip display", off_on }, | 308 | {1, S_O(remote_flip_display), false, "remote flip display", off_on }, |
308 | {5, S_O(remote_backlight_timeout), 6, "remote backlight timeout", | 309 | {5, S_O(remote_backlight_timeout), 6, "remote backlight timeout", |
@@ -1365,11 +1366,18 @@ void settings_load(int which) | |||
1365 | #ifdef HAVE_RECORDING | 1366 | #ifdef HAVE_RECORDING |
1366 | global_settings.recscreen_on = false; | 1367 | global_settings.recscreen_on = false; |
1367 | #endif | 1368 | #endif |
1369 | |||
1368 | #ifdef HAVE_LCD_CONTRAST | 1370 | #ifdef HAVE_LCD_CONTRAST |
1369 | if ( global_settings.contrast < MIN_CONTRAST_SETTING ) | 1371 | if ( global_settings.contrast < MIN_CONTRAST_SETTING || |
1372 | global_settings.contrast > MAX_CONTRAST_SETTING ) | ||
1370 | global_settings.contrast = lcd_default_contrast(); | 1373 | global_settings.contrast = lcd_default_contrast(); |
1371 | #endif | 1374 | #endif |
1372 | 1375 | ||
1376 | #ifdef HAVE_LCD_REMOTE | ||
1377 | if (global_settings.remote_contrast < MIN_REMOTE_CONTRAST_SETTING || | ||
1378 | global_settings.remote_contrast > MAX_REMOTE_CONTRAST_SETTING ) | ||
1379 | global_settings.remote_contrast = lcd_remote_default_contrast(); | ||
1380 | #endif | ||
1373 | i = 0xb8; | 1381 | i = 0xb8; |
1374 | strncpy((char *)global_settings.wps_file, (char *)&config_block[i], | 1382 | strncpy((char *)global_settings.wps_file, (char *)&config_block[i], |
1375 | MAX_FILENAME); | 1383 | MAX_FILENAME); |
diff --git a/apps/settings.h b/apps/settings.h index 9f8372415a..3e0b8fcd11 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -108,7 +108,6 @@ extern unsigned char vp_dummy[VIRT_SIZE]; | |||
108 | simplicity. */ | 108 | simplicity. */ |
109 | #if !defined(HAVE_LCD_COLOR) | 109 | #if !defined(HAVE_LCD_COLOR) |
110 | #define HAVE_LCD_CONTRAST | 110 | #define HAVE_LCD_CONTRAST |
111 | #define DEFAULT_CONTRAST_SETTING 40 | ||
112 | #endif | 111 | #endif |
113 | 112 | ||
114 | struct user_settings | 113 | struct user_settings |
@@ -545,6 +544,11 @@ extern const char rec_base_directory[]; | |||
545 | 544 | ||
546 | /* system defines */ | 545 | /* system defines */ |
547 | #ifndef TARGET_TREE | 546 | #ifndef TARGET_TREE |
547 | |||
548 | #ifndef HAVE_LCD_COLOR | ||
549 | #define DEFAULT_CONTRAST_SETTING 40 | ||
550 | #endif | ||
551 | |||
548 | #if defined HAVE_LCD_CHARCELLS | 552 | #if defined HAVE_LCD_CHARCELLS |
549 | #define MIN_CONTRAST_SETTING 5 | 553 | #define MIN_CONTRAST_SETTING 5 |
550 | #define MAX_CONTRAST_SETTING 31 | 554 | #define MAX_CONTRAST_SETTING 31 |
@@ -552,6 +556,17 @@ extern const char rec_base_directory[]; | |||
552 | #define MIN_CONTRAST_SETTING 5 | 556 | #define MIN_CONTRAST_SETTING 5 |
553 | #define MAX_CONTRAST_SETTING 63 | 557 | #define MAX_CONTRAST_SETTING 63 |
554 | #endif | 558 | #endif |
559 | |||
560 | /* As it was */ | ||
561 | #ifdef HAVE_REMOTE_LCD | ||
562 | #ifndef DEFAULT_REMOTE_CONTRAST_SETTING | ||
563 | /* May be defined in config file if driver code needs the value */ | ||
564 | #define DEFAULT_REMOTE_CONTRAST_SETTING 42 | ||
565 | #endif | ||
566 | #define MIN_REMOTE_CONTRAST_SETTING MIN_CONTRAST_SETTING | ||
567 | #define MAX_REMOTE_CONTRAST_SETTING MAX_CONTRAST_SETTING | ||
568 | #endif | ||
569 | |||
555 | #endif /* !TARGET_TREE */ | 570 | #endif /* !TARGET_TREE */ |
556 | 571 | ||
557 | /* argument bits for settings_load() */ | 572 | /* argument bits for settings_load() */ |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 36615cfc6a..27fc5653d1 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -124,8 +124,8 @@ static bool remote_contrast(void) | |||
124 | { | 124 | { |
125 | return set_int( str(LANG_CONTRAST), "", UNIT_INT, | 125 | return set_int( str(LANG_CONTRAST), "", UNIT_INT, |
126 | &global_settings.remote_contrast, | 126 | &global_settings.remote_contrast, |
127 | lcd_remote_set_contrast, 1, MIN_CONTRAST_SETTING, | 127 | lcd_remote_set_contrast, 1, MIN_REMOTE_CONTRAST_SETTING, |
128 | MAX_CONTRAST_SETTING, NULL ); | 128 | MAX_REMOTE_CONTRAST_SETTING, NULL ); |
129 | } | 129 | } |
130 | 130 | ||
131 | static bool remote_invert(void) | 131 | static bool remote_invert(void) |