Clip: add backlight and buttonlight code

Revive lcd_enable() as well, and use it in _backlight_on/off()
Don't update the lcd framebuffer if the display is off

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18952 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2008-10-31 22:02:41 +00:00
parent ee593c95e2
commit 603a9c7c7d
34 changed files with 184 additions and 97 deletions

View file

@ -149,6 +149,9 @@ void lcd_set_flip(bool yesno)
void lcd_enable(bool enable)
{
if(display_on == enable)
return;
if( (display_on = enable) ) /* simple '=' is not a typo ! */
lcd_write_command(LCD_SET_DISPLAY_ON);
else
@ -240,6 +243,9 @@ void lcd_init_device(void)
void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride)
{
if(!display_on)
return;
/* Copy display bitmap to hardware */
while (bheight--)
{
@ -258,6 +264,13 @@ void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int x, int by, int width, int bheight, int stride)
{
/* TODO */
#if 0
if(!display_on)
return;
#endif
(void)values;
(void)phases;
(void)x;
@ -274,6 +287,9 @@ void lcd_update(void)
{
int y;
if(!display_on)
return;
/* Copy display bitmap to hardware */
for (y = 0; y < LCD_FBHEIGHT; y++)
{
@ -291,6 +307,9 @@ void lcd_update_rect(int x, int y, int width, int height)
{
int ymax;
if(!display_on)
return;
/* The Y coordinates have to work on even 8 pixel rows */
ymax = (y + height-1) >> 3;
y >>= 3;