Hopefully fix the D2s 'cut and repeated LCD lines' bug (fix suggested by Francesco Rigoni).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18801 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rob Purchase 2008-10-13 20:25:16 +00:00
parent 7470797b37
commit 14a6fd9bbe
2 changed files with 14 additions and 1 deletions

View file

@ -424,6 +424,7 @@ Denes Balatoni
Roy Wallace Roy Wallace
Eric Lassauge Eric Lassauge
François Dinel François Dinel
Francesco Rigoni
The libmad team The libmad team
The wavpack team The wavpack team

View file

@ -73,24 +73,36 @@ void lcd_set_contrast(int val)
/* LTV250QV panel functions */ /* LTV250QV panel functions */
/* Delay loop based on CPU frequency (FREQ>>23 is 3..22 for 32MHz..192MHz) */
static void delay_loop(void)
{
unsigned long x;
for (x = (unsigned)(FREQ>>23); x; x--);
}
#define DELAY delay_loop()
static void ltv250qv_write(unsigned int command) static void ltv250qv_write(unsigned int command)
{ {
int i; int i;
GPIOA_CLEAR = LTV250QV_CS; GPIOA_CLEAR = LTV250QV_CS;
DELAY;
for (i = 23; i >= 0; i--) for (i = 23; i >= 0; i--)
{ {
GPIOA_CLEAR = LTV250QV_SCL; GPIOA_CLEAR = LTV250QV_SCL;
DELAY;
if ((command>>i) & 1) if ((command>>i) & 1)
GPIOA_SET = LTV250QV_SDI; GPIOA_SET = LTV250QV_SDI;
else else
GPIOA_CLEAR = LTV250QV_SDI; GPIOA_CLEAR = LTV250QV_SDI;
DELAY;
GPIOA_SET = LTV250QV_SCL; GPIOA_SET = LTV250QV_SCL;
} }
DELAY;
GPIOA_SET = LTV250QV_CS; GPIOA_SET = LTV250QV_CS;
} }
@ -162,7 +174,7 @@ static void lcd_display_on(void)
lcd_write_reg(3, 0xE100); lcd_write_reg(3, 0xE100);
lcd_write_reg(4, 0x1000); lcd_write_reg(4, 0x1000);
lcd_write_reg(5, 0x5033); lcd_write_reg(5, 0x5033);
lcd_write_reg(6, 0x4); lcd_write_reg(6, 0x2); /* vertical back porch adjusted from 0x4 in OF */
lcd_write_reg(7, 0x30); lcd_write_reg(7, 0x30);
lcd_write_reg(8, 0x41C); lcd_write_reg(8, 0x41C);
lcd_write_reg(16, 0x207); lcd_write_reg(16, 0x207);