]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
common/lcd: Add command for setting cursor within lcd-console
authorHannes Petermaier <oe5hpm@oevsv.at>
Tue, 3 Feb 2015 12:22:24 +0000 (13:22 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:20:09 +0000 (14:20 +0200)
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>
common/lcd_console.c

index 74c388a0cadccb06a4e9ba935310b78d2206ec3a..53632326062b924016132ffaf771451586d1ea5f 100644 (file)
@@ -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"
+);