Implement contrast setting for iPod greyscale LCD
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8643 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ee2019d591
commit
b0ad4cfbb5
2 changed files with 6 additions and 2 deletions
|
@ -84,7 +84,7 @@ void lcd_init(void)
|
|||
|
||||
int lcd_default_contrast(void)
|
||||
{
|
||||
return 96;
|
||||
return 40;
|
||||
}
|
||||
|
||||
/*** parameter handling ***/
|
||||
|
|
|
@ -158,9 +158,13 @@ void lcd_update(void)
|
|||
lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
|
||||
}
|
||||
|
||||
/* Rockbox stores the contrast as 0..63 - we add 64 to it */
|
||||
void lcd_set_contrast(int val)
|
||||
{
|
||||
lcd_cmd_and_data(0x4, 0x4, val);
|
||||
if (val < 0) val = 0;
|
||||
else if (val > 63) val = 63;
|
||||
|
||||
lcd_cmd_and_data(0x4, 0x4, val + 64);
|
||||
lcd_contrast = val;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue