summaryrefslogtreecommitdiff
path: root/board/mcc200/lcd.c
diff options
context:
space:
mode:
authorSergei Poselenov <sposelenov@emcraft.com>2007-02-27 12:40:16 +0300
committerWolfgang Denk <wd@denx.de>2007-02-27 14:17:09 +0100
commit638dd1458bbdc2a55d4b9e25c5c4e1f838a5dc72 (patch)
treead842efc4e5d750f3d7ce618feacee6f1a3b4ff2 /board/mcc200/lcd.c
parent6c7cac8c4fce0ea2bf8e15ed8658d87974155b44 (diff)
downloadu-boot-imx-638dd1458bbdc2a55d4b9e25c5c4e1f838a5dc72.zip
u-boot-imx-638dd1458bbdc2a55d4b9e25c5c4e1f838a5dc72.tar.gz
u-boot-imx-638dd1458bbdc2a55d4b9e25c5c4e1f838a5dc72.tar.bz2
MCC200 update - add LCD Progress Indicator
Diffstat (limited to 'board/mcc200/lcd.c')
-rw-r--r--board/mcc200/lcd.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/board/mcc200/lcd.c b/board/mcc200/lcd.c
index b262516..98b86d1 100644
--- a/board/mcc200/lcd.c
+++ b/board/mcc200/lcd.c
@@ -24,13 +24,13 @@
#ifdef CONFIG_LCD
-#define SWAPPED_LCD
+#undef SWAPPED_LCD /* For the previous h/w version */
/*
* The name of the device used for communication
* with the PSoC.
*/
#define PSOC_PSC MPC5XXX_PSC2
-#define PSOC_BAUD 500000UL
+#define PSOC_BAUD 230400UL
#define RTS_ASSERT 1
#define RTS_NEGATE 0
@@ -181,10 +181,35 @@ void lcd_enable (void)
udelay (PSOC_WAIT_TIME);
}
if (!retries) {
- printf ("%s Error: PSoC doesn't respond on "
+ printf ("%s Warning: PSoC doesn't respond on "
"RTS NEGATE\n", __FUNCTION__);
}
return;
}
+#ifdef CONFIG_PROGRESSBAR
+
+#define FONT_WIDTH 8 /* the same as VIDEO_FONT_WIDTH in video_font.h */
+void show_progress (int size, int tot)
+{
+ int cnt;
+ int i;
+ static int rc = 0;
+
+ rc += size;
+
+ cnt = ((LCD_WIDTH/FONT_WIDTH) * rc) / tot;
+
+ rc -= (cnt * tot) / (LCD_WIDTH/FONT_WIDTH);
+
+ for (i = 0; i < cnt; i++) {
+ lcd_putc(0xdc);
+ }
+
+ if (cnt) {
+ lcd_enable(); /* MCC200-specific - send the framebuffer to PSoC */
+ }
+}
+
+#endif
#endif /* CONFIG_LCD */