Skip to content
Snippets Groups Projects
Commit d38d0c6a authored by Hannes Petermaier's avatar Hannes Petermaier Committed by Tom Rini
Browse files

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: default avatarHannes Petermaier <oe5hpm@oevsv.at>
parent 3b4e16eb
No related branches found
No related tags found
No related merge requests found
...@@ -209,3 +209,24 @@ void lcd_printf(const char *fmt, ...) ...@@ -209,3 +209,24 @@ void lcd_printf(const char *fmt, ...)
lcd_puts(buf); 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"
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment