One more try: Fix remaining reds and yellows

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20335 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-03-17 04:01:11 +00:00
parent 7e7d8ebfef
commit 9771c9c771
8 changed files with 80 additions and 77 deletions

View file

@ -57,8 +57,8 @@
should be defined as well.
#define HAVE_LCD_SLEEP
#define HAVE_LCD_SLEEP_SETTING
#endif
*/
#endif
/* define this if you can flip your LCD */
#define HAVE_LCD_FLIP

View file

@ -57,8 +57,8 @@
should be defined as well.
#define HAVE_LCD_SLEEP
#define HAVE_LCD_SLEEP_SETTING
#endif
*/
#endif
/* define this if you can flip your LCD */
#define HAVE_LCD_FLIP

View file

@ -599,7 +599,7 @@ void lcd_sleep(void)
bool lcd_active(void)
{
return lcd_state.display;
return lcd_state.display_on;
}
#ifdef HAVE_LCD_SHUTDOWN

View file

@ -274,6 +274,7 @@ static void lcd_power_on(void)
power_on = true;
}
#ifdef HAVE_LCD_SLEEP
static void lcd_power_off(void)
{
/* Display must be off first */
@ -302,6 +303,42 @@ static void lcd_power_off(void)
lcd_write_reg(R_POWER_CONTROL1, 0x0000);
}
void lcd_sleep(void)
{
if (power_on)
lcd_power_off();
/* Set standby mode */
/* BT2-0=000, DC2-0=000, AP2-0=000, SLP=0, STB=1 */
lcd_write_reg(R_POWER_CONTROL1, 0x0001);
}
#endif
static void lcd_display_off(void)
{
display_on = false;
/** Display OFF sequence **/
/* Per datasheet Rev.1.10, Jun.21.2003, p. 97 */
/* EQ1-0=00 already */
/* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=1, REV=x, D1-0=10 */
lcd_write_reg(R_DISP_CONTROL, 0x0032 | disp_control_rev);
sleep(HZ/25); /* Wait 2 frames or more */
/* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=0, REV=x, D1-0=10 */
lcd_write_reg(R_DISP_CONTROL, 0x0022 | disp_control_rev);
sleep(HZ/25); /* Wait 2 frames or more */
/* PT1-0=00, VLE2-1=00, SPT=0, GON=0, DTE=0, REV=0, D1-0=00 */
lcd_write_reg(R_DISP_CONTROL, 0x0000);
}
#if defined(HAVE_LCD_ENABLE)
static void lcd_display_on(void)
{
/* Be sure power is on first */
@ -329,30 +366,6 @@ static void lcd_display_on(void)
display_on = true;
}
static void lcd_display_off(void)
{
display_on = false;
/** Display OFF sequence **/
/* Per datasheet Rev.1.10, Jun.21.2003, p. 97 */
/* EQ1-0=00 already */
/* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=1, REV=x, D1-0=10 */
lcd_write_reg(R_DISP_CONTROL, 0x0032 | disp_control_rev);
sleep(HZ/25); /* Wait 2 frames or more */
/* PT1-0=00, VLE2-1=00, SPT=0, GON=1, DTE=0, REV=x, D1-0=10 */
lcd_write_reg(R_DISP_CONTROL, 0x0022 | disp_control_rev);
sleep(HZ/25); /* Wait 2 frames or more */
/* PT1-0=00, VLE2-1=00, SPT=0, GON=0, DTE=0, REV=0, D1-0=00 */
lcd_write_reg(R_DISP_CONTROL, 0x0000);
}
#if defined(HAVE_LCD_ENABLE)
void lcd_enable(bool on)
{
if (on == display_on)
@ -373,18 +386,6 @@ void lcd_enable(bool on)
}
#endif
#ifdef HAVE_LCD_SLEEP
void lcd_sleep(void)
{
if (power_on)
lcd_power_off();
/* Set standby mode */
/* BT2-0=000, DC2-0=000, AP2-0=000, SLP=0, STB=1 */
lcd_write_reg(R_POWER_CONTROL1, 0x0001);
}
#endif
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
bool lcd_active(void)
{

View file

@ -181,29 +181,6 @@ static void LCD_SPI_stop(void)
s3c_regclr32(&CLKCON, 0x40000); /* disable SPI clock */
}
static void LCD_SPI_powerdown(void)
{
lcd_powered = false;
LCD_SPI_start();
LCD_SPI_setreg(0x04, 0x00);
LCD_SPI_stop();
reset_LCD(false); /* This makes a big difference on power */
LCD_CTRL_clock(false);
}
static void LCD_SPI_powerup(void)
{
LCD_CTRL_clock(true);
LCD_SPI_start();
LCD_SPI_setreg(0x04, 0x01);
LCD_SPI_stop();
lcd_powered = true;
}
static void LCD_SPI_init(void)
{
/*
@ -281,6 +258,18 @@ void lcd_init_device(void)
}
#if defined(HAVE_LCD_SLEEP)
static void LCD_SPI_powerdown(void)
{
lcd_powered = false;
LCD_SPI_start();
LCD_SPI_setreg(0x04, 0x00);
LCD_SPI_stop();
reset_LCD(false); /* This makes a big difference on power */
LCD_CTRL_clock(false);
}
void lcd_sleep(void)
{
if (lcd_powered)
@ -295,6 +284,17 @@ void lcd_sleep(void)
#endif
#if defined(HAVE_LCD_ENABLE)
static void LCD_SPI_powerup(void)
{
LCD_CTRL_clock(true);
LCD_SPI_start();
LCD_SPI_setreg(0x04, 0x01);
LCD_SPI_stop();
lcd_powered = true;
}
void lcd_enable(bool state)
{
if (state == lcd_on)

View file

@ -196,7 +196,7 @@ void lcd_enable(bool yesno)
if (yesno == is_lcd_enabled)
return;
if (is_lcd_enabled = yesno)
if ((is_lcd_enabled = yesno))
{
lcd_send_command(R_STANDBY_OFF);
lcd_send_command(R_DISPLAY_ON);

View file

@ -225,7 +225,7 @@ static void lcd_display_off(void)
display_on = false;
}
#ifdef HAVE_LCD_ENABLE
void lcd_enable(bool on)
{
/* Disabled until properly working */
@ -244,11 +244,14 @@ return;
lcd_display_off(); /* Turn off display */
}
}
#endif
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
bool lcd_active(void)
{
return display_on;
}
#endif
void lcd_set_direct_fb(bool yes)
{

View file

@ -267,6 +267,7 @@ static void lcd_power_on(void)
power_on = true;
}
#if defined(HAVE_LCD_SLEEP)
static void lcd_power_off(void)
{
/* Display must be off first */
@ -295,6 +296,17 @@ static void lcd_power_off(void)
lcd_write_reg(R_POWER_CONTROL1, 0x0000);
}
void lcd_sleep(void)
{
if (power_on)
lcd_power_off();
/* Set standby mode */
/* BT2-0=000, DC2-0=000, AP2-0=000, SLP=0, STB=1 */
lcd_write_reg(R_POWER_CONTROL1, 0x0001);
}
#endif
static void lcd_display_on(void)
{
/* Be sure power is on first */
@ -395,19 +407,6 @@ void lcd_enable(bool on)
}
#endif
#if defined(HAVE_LCD_SLEEP)
void lcd_sleep(void)
{
if (power_on)
lcd_power_off();
/* Set standby mode */
/* BT2-0=000, DC2-0=000, AP2-0=000, SLP=0, STB=1 */
lcd_write_reg(R_POWER_CONTROL1, 0x0001);
}
#endif
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
bool lcd_active(void)
{