mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
D2: Make lcd_init_device() actually turn on the LCD, in preparation for booting the main image. Previously this required an explicit lcd_enable(true).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16523 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6ef63a5373
commit
562b9de7cb
2 changed files with 19 additions and 15 deletions
|
@ -62,8 +62,8 @@ void* main(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
power_init();
|
power_init();
|
||||||
lcd_init();
|
|
||||||
system_init();
|
system_init();
|
||||||
|
lcd_init();
|
||||||
|
|
||||||
#if defined(COWON_D2)
|
#if defined(COWON_D2)
|
||||||
kernel_init();
|
kernel_init();
|
||||||
|
@ -74,13 +74,8 @@ void* main(void)
|
||||||
backlight_init();
|
backlight_init();
|
||||||
|
|
||||||
font_init();
|
font_init();
|
||||||
|
|
||||||
lcd_setfont(FONT_SYSFIXED);
|
lcd_setfont(FONT_SYSFIXED);
|
||||||
|
|
||||||
#if defined(COWON_D2)
|
|
||||||
lcd_enable(true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_backlight_on();
|
_backlight_on();
|
||||||
|
|
||||||
#if defined(COWON_D2)
|
#if defined(COWON_D2)
|
||||||
|
|
|
@ -222,12 +222,14 @@ void lcd_enable(bool on)
|
||||||
|
|
||||||
if (on)
|
if (on)
|
||||||
{
|
{
|
||||||
lcd_display_on(); /* Turn on display */
|
LCDC_CTRL |= 1; /* controller enable */
|
||||||
|
GPIOA_SET = (1<<6); /* backlight enable - not visible otherwise */
|
||||||
lcd_update(); /* Resync display */
|
lcd_update(); /* Resync display */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lcd_display_off(); /* Turn off display */
|
LCDC_CTRL &= ~1; /* controller disable */
|
||||||
|
GPIOA_CLEAR = (1<<6); /* backlight off */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,6 +238,7 @@ bool lcd_enabled(void)
|
||||||
return display_on;
|
return display_on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: implement lcd_sleep() and separate out the power on/off functions */
|
||||||
|
|
||||||
void lcd_init_device(void)
|
void lcd_init_device(void)
|
||||||
{
|
{
|
||||||
|
@ -264,22 +267,28 @@ void lcd_init_device(void)
|
||||||
|
|
||||||
LCDC_I1BASE = (unsigned int)lcd_framebuffer; /* dirty, dirty hack */
|
LCDC_I1BASE = (unsigned int)lcd_framebuffer; /* dirty, dirty hack */
|
||||||
LCDC_I1SIZE = (LCD_HEIGHT<<16) | LCD_WIDTH; /* image 1 size */
|
LCDC_I1SIZE = (LCD_HEIGHT<<16) | LCD_WIDTH; /* image 1 size */
|
||||||
//LCDC_I1POS = (0<<16) | 0; /* position */
|
LCDC_I1POS = (0<<16) | 0; /* position */
|
||||||
//LCDC_I1OFF = 0; /* address offset */
|
LCDC_I1OFF = 0; /* address offset */
|
||||||
//LCDC_I1SCALE = 0; /* scaling */
|
LCDC_I1SCALE = 0; /* scaling */
|
||||||
LCDC_I1CTRL = 5; /* 565bpp (7 = 888bpp) */
|
LCDC_I1CTRL = 5; /* 565bpp (7 = 888bpp) */
|
||||||
//LCDC_CTRL &= ~(1<<28);
|
LCDC_CTRL &= ~(1<<28);
|
||||||
|
|
||||||
LCDC_CLKDIV = (LCDC_CLKDIV &~ 0xFF00FF) | (1<<16) | 2; /* and this means? */
|
LCDC_CLKDIV = (LCDC_CLKDIV &~ 0xFF00FF) | (1<<16) | 2; /* and this means? */
|
||||||
|
|
||||||
/* set and clear various flags - not investigated yet */
|
/* set and clear various flags - not investigated yet */
|
||||||
//LCDC_CTRL &~ 0x090006AA; /* clear bits 1,3,5,7,9,10,24,27 */
|
LCDC_CTRL &~ 0x090006AA; /* clear bits 1,3,5,7,9,10,24,27 */
|
||||||
LCDC_CTRL |= 0x02800144; /* set bits 2,6,8,25,23 */
|
LCDC_CTRL |= 0x02800144; /* set bits 2,6,8,25,23 */
|
||||||
LCDC_CTRL = (LCDC_CTRL &~ 0xF0000) | 0x20000;
|
LCDC_CTRL = (LCDC_CTRL &~ 0xF0000) | 0x20000;
|
||||||
//LCDC_CTRL = (LCDC_CTRL &~ 0x700000) | 0x700000;
|
LCDC_CTRL = (LCDC_CTRL &~ 0x700000) | 0x700000;
|
||||||
|
|
||||||
/* enable LCD controller */
|
/* enable LCD controller */
|
||||||
LCDC_CTRL |= 1;
|
LCDC_CTRL |= 1;
|
||||||
|
|
||||||
|
/* enable LTV250QV panel */
|
||||||
|
lcd_display_on();
|
||||||
|
|
||||||
|
/* turn on the backlight, without it the LCD is not visible at all */
|
||||||
|
GPIOA_SET = (1<<6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue