summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-ipod.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-ipod.c')
-rw-r--r--firmware/drivers/lcd-ipod.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/firmware/drivers/lcd-ipod.c b/firmware/drivers/lcd-ipod.c
index d37981a964..d1d63b9911 100644
--- a/firmware/drivers/lcd-ipod.c
+++ b/firmware/drivers/lcd-ipod.c
@@ -158,9 +158,13 @@ void lcd_update(void)
158 lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); 158 lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
159} 159}
160 160
161/* Rockbox stores the contrast as 0..63 - we add 64 to it */
161void lcd_set_contrast(int val) 162void lcd_set_contrast(int val)
162{ 163{
163 lcd_cmd_and_data(0x4, 0x4, val); 164 if (val < 0) val = 0;
165 else if (val > 63) val = 63;
166
167 lcd_cmd_and_data(0x4, 0x4, val + 64);
164 lcd_contrast = val; 168 lcd_contrast = val;
165} 169}
166 170