diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/ipod/lcd-gray.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/firmware/target/arm/ipod/lcd-gray.c b/firmware/target/arm/ipod/lcd-gray.c index 811e64e96b..0cd04772fe 100644 --- a/firmware/target/arm/ipod/lcd-gray.c +++ b/firmware/target/arm/ipod/lcd-gray.c | |||
@@ -70,6 +70,16 @@ static void invert_display(void); | |||
70 | 70 | ||
71 | #define CONTRAST_REG_H 0x400 | 71 | #define CONTRAST_REG_H 0x400 |
72 | 72 | ||
73 | #if defined(IPOD_1G2G) | ||
74 | #define DEFAULT_CONTRAST 45 | ||
75 | #elif defined(IPOD_3G) | ||
76 | #define DEFAULT_CONTRAST 55 | ||
77 | #elif defined(IPOD_MINI) || defined(IPOD_MINI2G) | ||
78 | #define DEFAULT_CONTRAST 42 | ||
79 | #elif defined(IPOD_4G) | ||
80 | #define DEFAULT_CONTRAST 35 | ||
81 | #endif | ||
82 | |||
73 | /* needed for flip */ | 83 | /* needed for flip */ |
74 | static int addr_offset; | 84 | static int addr_offset; |
75 | #if defined(IPOD_MINI) || defined(IPOD_MINI2G) | 85 | #if defined(IPOD_MINI) || defined(IPOD_MINI2G) |
@@ -135,6 +145,7 @@ void lcd_init_device(void) | |||
135 | /* C waveform, no EOR, 9 lines inversion */ | 145 | /* C waveform, no EOR, 9 lines inversion */ |
136 | lcd_cmd_and_data(R_POWER_CONTROL, POWER_REG_H | 0xc); | 146 | lcd_cmd_and_data(R_POWER_CONTROL, POWER_REG_H | 0xc); |
137 | lcd_cmd_and_data(R_DISPLAY_CONTROL, 0x0019); | 147 | lcd_cmd_and_data(R_DISPLAY_CONTROL, 0x0019); |
148 | lcd_set_contrast(DEFAULT_CONTRAST); | ||
138 | #ifdef HAVE_BACKLIGHT_INVERSION | 149 | #ifdef HAVE_BACKLIGHT_INVERSION |
139 | invert_display(); | 150 | invert_display(); |
140 | #endif | 151 | #endif |
@@ -146,15 +157,7 @@ void lcd_init_device(void) | |||
146 | 157 | ||
147 | int lcd_default_contrast(void) | 158 | int lcd_default_contrast(void) |
148 | { | 159 | { |
149 | #if defined(IPOD_1G2G) | 160 | return DEFAULT_CONTRAST; |
150 | return 45; | ||
151 | #elif defined(IPOD_3G) | ||
152 | return 55; | ||
153 | #elif defined(IPOD_MINI) || defined(IPOD_MINI2G) | ||
154 | return 42; | ||
155 | #elif defined(IPOD_4G) | ||
156 | return 35; | ||
157 | #endif | ||
158 | } | 161 | } |
159 | 162 | ||
160 | /* Rockbox stores the contrast as 0..63 - we add 64 to it */ | 163 | /* Rockbox stores the contrast as 0..63 - we add 64 to it */ |