diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd-h100-remote.c | 6 | ||||
-rw-r--r-- | firmware/export/config-h100.h | 2 | ||||
-rw-r--r-- | firmware/export/config-h120.h | 2 | ||||
-rw-r--r-- | firmware/export/config-iaudiox5.h | 6 | ||||
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c | 11 |
5 files changed, 19 insertions, 8 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index a200c7bcb1..75d42f8371 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c | |||
@@ -73,8 +73,6 @@ static int xmargin = 0; | |||
73 | static int ymargin = 0; | 73 | static int ymargin = 0; |
74 | static int curfont = FONT_SYSFIXED; | 74 | static int curfont = FONT_SYSFIXED; |
75 | 75 | ||
76 | #define LCD_REMOTE_DEFAULT_CONTRAST 42; | ||
77 | |||
78 | #ifndef SIMULATOR | 76 | #ifndef SIMULATOR |
79 | static int xoffset; /* needed for flip */ | 77 | static int xoffset; /* needed for flip */ |
80 | 78 | ||
@@ -99,7 +97,7 @@ static int _remote_type = REMOTETYPE_UNPLUGGED; | |||
99 | /* cached settings values */ | 97 | /* cached settings values */ |
100 | static bool cached_invert = false; | 98 | static bool cached_invert = false; |
101 | static bool cached_flip = false; | 99 | static bool cached_flip = false; |
102 | static int cached_contrast = LCD_REMOTE_DEFAULT_CONTRAST; | 100 | static int cached_contrast = DEFAULT_REMOTE_CONTRAST_SETTING; |
103 | #endif | 101 | #endif |
104 | 102 | ||
105 | /* scrolling */ | 103 | /* scrolling */ |
@@ -397,7 +395,7 @@ void lcd_remote_write_data(const unsigned char* p_bytes, int count) | |||
397 | 395 | ||
398 | int lcd_remote_default_contrast(void) | 396 | int lcd_remote_default_contrast(void) |
399 | { | 397 | { |
400 | return LCD_REMOTE_DEFAULT_CONTRAST; | 398 | return DEFAULT_REMOTE_CONTRAST_SETTING; |
401 | } | 399 | } |
402 | 400 | ||
403 | #ifndef SIMULATOR | 401 | #ifndef SIMULATOR |
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index aacb30dd44..71baa83100 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h | |||
@@ -50,6 +50,8 @@ | |||
50 | 50 | ||
51 | #define CONFIG_LCD LCD_S1D15E06 | 51 | #define CONFIG_LCD LCD_S1D15E06 |
52 | 52 | ||
53 | #define DEFAULT_REMOTE_CONTRAST_SETTING 42 | ||
54 | |||
53 | /* Define this for LCD backlight available */ | 55 | /* Define this for LCD backlight available */ |
54 | #define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */ | 56 | #define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */ |
55 | 57 | ||
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index 79ad613968..e6aa822376 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h | |||
@@ -46,6 +46,8 @@ | |||
46 | 46 | ||
47 | #define CONFIG_LCD LCD_S1D15E06 | 47 | #define CONFIG_LCD LCD_S1D15E06 |
48 | 48 | ||
49 | #define DEFAULT_REMOTE_CONTRAST_SETTING 42 | ||
50 | |||
49 | /* Define this for LCD backlight available */ | 51 | /* Define this for LCD backlight available */ |
50 | #define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */ | 52 | #define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */ |
51 | 53 | ||
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index c3cd157781..83f0767723 100644 --- a/firmware/export/config-iaudiox5.h +++ b/firmware/export/config-iaudiox5.h | |||
@@ -47,10 +47,16 @@ | |||
47 | 47 | ||
48 | #define CONFIG_LCD LCD_X5 | 48 | #define CONFIG_LCD LCD_X5 |
49 | 49 | ||
50 | /* Main LCD contrast range and defaults */ | ||
50 | #define MIN_CONTRAST_SETTING 1 | 51 | #define MIN_CONTRAST_SETTING 1 |
51 | #define MAX_CONTRAST_SETTING 30 | 52 | #define MAX_CONTRAST_SETTING 30 |
52 | #define DEFAULT_CONTRAST_SETTING 19 /* Match boot contrast */ | 53 | #define DEFAULT_CONTRAST_SETTING 19 /* Match boot contrast */ |
53 | 54 | ||
55 | /* Remote LCD contrast range and defaults */ | ||
56 | #define MIN_REMOTE_CONTRAST_SETTING 10 | ||
57 | #define MAX_REMOTE_CONTRAST_SETTING 35 | ||
58 | #define DEFAULT_REMOTE_CONTRAST_SETTING 24 /* Match boot contrast */ | ||
59 | |||
54 | /* Define this for LCD backlight available */ | 60 | /* Define this for LCD backlight available */ |
55 | #define CONFIG_BACKLIGHT BL_X5 /* PCF50606 I2C */ | 61 | #define CONFIG_BACKLIGHT BL_X5 /* PCF50606 I2C */ |
56 | #define HAVE_BACKLIGHT_BRIGHTNESS | 62 | #define HAVE_BACKLIGHT_BRIGHTNESS |
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c index 46e1eba1fd..6e3bb01a15 100755 --- a/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c +++ b/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c | |||
@@ -51,12 +51,10 @@ | |||
51 | #define RS_LO and_l(~0x00008000, &GPIO_OUT) | 51 | #define RS_LO and_l(~0x00008000, &GPIO_OUT) |
52 | #define RS_HI or_l(0x00008000, &GPIO_OUT) | 52 | #define RS_HI or_l(0x00008000, &GPIO_OUT) |
53 | 53 | ||
54 | #define LCD_REMOTE_DEFAULT_CONTRAST 0x18; | ||
55 | |||
56 | /* cached settings values */ | 54 | /* cached settings values */ |
57 | static bool cached_invert = false; | 55 | static bool cached_invert = false; |
58 | static bool cached_flip = false; | 56 | static bool cached_flip = false; |
59 | static int cached_contrast = LCD_REMOTE_DEFAULT_CONTRAST; | 57 | static int cached_contrast = DEFAULT_REMOTE_CONTRAST_SETTING; |
60 | 58 | ||
61 | bool remote_initialized = false; | 59 | bool remote_initialized = false; |
62 | 60 | ||
@@ -294,7 +292,7 @@ void lcd_remote_write_data(const unsigned char* p_bytes, int count) | |||
294 | 292 | ||
295 | int lcd_remote_default_contrast(void) | 293 | int lcd_remote_default_contrast(void) |
296 | { | 294 | { |
297 | return LCD_REMOTE_DEFAULT_CONTRAST; | 295 | return DEFAULT_REMOTE_CONTRAST_SETTING; |
298 | } | 296 | } |
299 | 297 | ||
300 | void lcd_remote_powersave(bool on) | 298 | void lcd_remote_powersave(bool on) |
@@ -309,6 +307,11 @@ void lcd_remote_powersave(bool on) | |||
309 | 307 | ||
310 | void lcd_remote_set_contrast(int val) | 308 | void lcd_remote_set_contrast(int val) |
311 | { | 309 | { |
310 | if (val < 0) | ||
311 | val = 0; | ||
312 | else if (val > 63) | ||
313 | val = 63; | ||
314 | |||
312 | cached_contrast = val; | 315 | cached_contrast = val; |
313 | if(remote_initialized) | 316 | if(remote_initialized) |
314 | lcd_remote_write_command_ex(LCD_SET_VOLUME, val); | 317 | lcd_remote_write_command_ex(LCD_SET_VOLUME, val); |