diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2003-06-25 23:24:47 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2003-06-25 23:24:47 +0000 |
commit | 9fb2d344477e1fdaede67dc0931ea393b71ad6bf (patch) | |
tree | 090a42a3c123bcb41a4762054e81fe3f7a65d404 | |
parent | df34e6b71a04c70ecd1164341bdd1c58477e697f (diff) | |
download | rockbox-9fb2d344477e1fdaede67dc0931ea393b71ad6bf.tar.gz rockbox-9fb2d344477e1fdaede67dc0931ea393b71ad6bf.zip |
Default contrast is now autodetected on recorders
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3761 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/settings.c | 18 | ||||
-rw-r--r-- | apps/settings_menu.c | 3 | ||||
-rw-r--r-- | firmware/export/hwcompat.h | 1 |
3 files changed, 17 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 @@ | |||
61 | struct user_settings global_settings; | 62 | struct user_settings global_settings; |
62 | char rockboxdir[] = ROCKBOX_DIR; /* config/font/data file directory */ | 63 | char 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 | ||
553 | static 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 @@ | |||
46 | static bool contrast(void) | 46 | static 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 | ||
52 | static bool caption_backlight(void) | 53 | static bool caption_backlight(void) |
diff --git a/firmware/export/hwcompat.h b/firmware/export/hwcompat.h index 52d831222f..ef3892b1fa 100644 --- a/firmware/export/hwcompat.h +++ b/firmware/export/hwcompat.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #define ATA_ADDRESS_200 0x0100 | 26 | #define ATA_ADDRESS_200 0x0100 |
27 | #define USB_ACTIVE_HIGH 0x0100 | 27 | #define USB_ACTIVE_HIGH 0x0100 |
28 | #define PR_ACTIVE_HIGH 0x0100 | 28 | #define PR_ACTIVE_HIGH 0x0100 |
29 | #define LCD_CONTRAST_BIAS 0x0200 | ||
29 | 30 | ||
30 | int read_rom_version(void); | 31 | int read_rom_version(void); |
31 | int read_hw_mask(void); | 32 | int read_hw_mask(void); |