summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tcc780x
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2008-10-13 20:25:16 +0000
committerRob Purchase <shotofadds@rockbox.org>2008-10-13 20:25:16 +0000
commit14a6fd9bbe9c80edbc3b414e47376a20908cdba1 (patch)
tree6f9062b9b9441100b1a8cfcfbbbdd95137491b5e /firmware/target/arm/tcc780x
parent7470797b3757e851fe88d713aaa832d18be17c7a (diff)
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
Diffstat (limited to 'firmware/target/arm/tcc780x')
-rw-r--r--firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c
index 70d823a25b..b41117c259 100644
--- a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c
@@ -73,24 +73,36 @@ void lcd_set_contrast(int val)
/* 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)
{
int i;
GPIOA_CLEAR = LTV250QV_CS;
+ DELAY;
for (i = 23; i >= 0; i--)
{
GPIOA_CLEAR = LTV250QV_SCL;
+ DELAY;
if ((command>>i) & 1)
GPIOA_SET = LTV250QV_SDI;
else
GPIOA_CLEAR = LTV250QV_SDI;
+ DELAY;
GPIOA_SET = LTV250QV_SCL;
}
+ DELAY;
GPIOA_SET = LTV250QV_CS;
}
@@ -162,7 +174,7 @@ static void lcd_display_on(void)
lcd_write_reg(3, 0xE100);
lcd_write_reg(4, 0x1000);
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(8, 0x41C);
lcd_write_reg(16, 0x207);