From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Petermaier Date: Fri, 30 Jan 2015 14:25:05 +0100 Subject: [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework In-Reply-To: <1422624324-15431-1-git-send-email-oe5hpm@oevsv.at> References: <1422624324-15431-1-git-send-email-oe5hpm@oevsv.at> Message-ID: <1422624324-15431-2-git-send-email-oe5hpm@oevsv.at> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de We need this function if we want to make some outputs i.e position the writing cursor out of u-boot scripts. Signed-off-by: Hannes Petermaier --- common/lcd.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/common/lcd.c b/common/lcd.c index cc34b8a..f418da9 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -279,12 +279,33 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc, return 0; } +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( cls, 1, 1, do_lcd_clear, "clear screen", "" ); +U_BOOT_CMD( + setcurs, 3, 1, do_lcd_setcursor, + "sets cursor for 'puts'", + " in character" +); + /*----------------------------------------------------------------------*/ static int lcd_init(void *lcdbase) -- 1.7.9.5