summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorHannes Petermaier <oe5hpm@oevsv.at>2015-02-03 13:22:24 +0100
committerTom Rini <trini@konsulko.com>2015-03-05 20:13:16 -0500
commitd38d0c6a33c0ef087e030ca1731e485e854c05fa (patch)
treea3802630bf4912584ccd04fd51230f0f61f89d7b /common
parent3b4e16eb530aa3eaa29535a7d511c105c0de963a (diff)
downloadblackbird-obmc-uboot-d38d0c6a33c0ef087e030ca1731e485e854c05fa.tar.gz
blackbird-obmc-uboot-d38d0c6a33c0ef087e030ca1731e485e854c05fa.zip
common/lcd: Add command for setting cursor within lcd-console
Sometimes we do not want redirect u-boot's console to screen but anyway we want write out some status information out of a u-boot script to the display. To define the specific position of the string to be written, we have to set the cursor with "setcurs" before writing. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
Diffstat (limited to 'common')
-rw-r--r--common/lcd_console.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/lcd_console.c b/common/lcd_console.c
index 74c388a0ca..5363232606 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -209,3 +209,24 @@ void lcd_printf(const char *fmt, ...)
lcd_puts(buf);
}
+
+static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ unsigned int col, row;
+
+ if (argc != 3)
+ return CMD_RET_USAGE;
+
+ col = simple_strtoul(argv[1], NULL, 10);
+ row = simple_strtoul(argv[2], NULL, 10);
+ lcd_position_cursor(col, row);
+
+ return 0;
+}
+
+U_BOOT_CMD(
+ setcurs, 3, 1, do_lcd_setcursor,
+ "set cursor position within screen",
+ " <col> <row> in character"
+);
OpenPOWER on IntegriCloud