diff mbox

[U-Boot,v2,03/24] common/lcd: Add command for writing to lcd-display

Message ID 1422966166-3973-3-git-send-email-oe5hpm@oevsv.at
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Hannes Schmelzer Feb. 3, 2015, 12:22 p.m. UTC
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.

So we cannot use the normal "echo ....", instead we write explicitly using
"lcdputs ..." for writing to the actual cursor position on LCD.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>

---
Changes for v2:
  - better understandable commit-message
  - rename "puts" into "lcdputs"
  - move code from lcd.c to lcd_console.c
---
 common/lcd_console.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Tom Rini March 6, 2015, 3:44 p.m. UTC | #1
On Tue, Feb 03, 2015 at 01:22:25PM +0100, Hannes Petermaier wrote:

> 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.
> 
> So we cannot use the normal "echo ....", instead we write explicitly using
> "lcdputs ..." for writing to the actual cursor position on LCD.
> 
> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 5363232..8bf83b9 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -225,8 +225,26 @@  static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
 	return 0;
 }
 
+static int do_lcd_puts(cmd_tbl_t *cmdtp, int flag, int argc,
+		       char *const argv[])
+{
+	if (argc != 2)
+		return CMD_RET_USAGE;
+
+	lcd_puts(argv[1]);
+
+	return 0;
+}
+
 U_BOOT_CMD(
 	setcurs, 3,	1,	do_lcd_setcursor,
 	"set cursor position within screen",
 	"    <col> <row> in character"
 );
+
+U_BOOT_CMD(
+	lcdputs, 2,	1,	do_lcd_puts,
+	"print string on lcd-framebuffer",
+	"    <string>"
+);
+