2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2005-08-30 11:04:12 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2005
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <command.h>
|
2010-09-09 21:03:32 +00:00
|
|
|
#include <led-display.h>
|
2005-08-30 11:04:12 +00:00
|
|
|
|
|
|
|
#undef DEBUG_DISP
|
|
|
|
|
2010-06-28 20:00:46 +00:00
|
|
|
int do_display (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
2005-08-30 11:04:12 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Clear display */
|
2010-09-09 21:03:32 +00:00
|
|
|
display_set(DISPLAY_CLEAR | DISPLAY_HOME);
|
2005-08-30 11:04:12 +00:00
|
|
|
|
|
|
|
if (argc < 2)
|
|
|
|
return (0);
|
|
|
|
|
2010-09-09 21:03:32 +00:00
|
|
|
for (i = 1; i < argc; i++) {
|
|
|
|
char *p = argv[i];
|
2005-08-30 11:04:12 +00:00
|
|
|
|
2010-09-09 21:03:32 +00:00
|
|
|
if (i > 1) { /* Insert a space between strings */
|
|
|
|
display_putc(' ');
|
2005-08-30 11:04:12 +00:00
|
|
|
}
|
|
|
|
|
2010-09-09 21:03:32 +00:00
|
|
|
while ((*p)) {
|
2005-08-30 11:04:12 +00:00
|
|
|
#ifdef DEBUG_DISP
|
2010-09-09 21:03:32 +00:00
|
|
|
putc(*p);
|
2005-08-30 11:04:12 +00:00
|
|
|
#endif
|
2010-09-09 21:03:32 +00:00
|
|
|
display_putc(*p++);
|
2005-08-30 11:04:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef DEBUG_DISP
|
|
|
|
putc('\n');
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************/
|
|
|
|
|
|
|
|
U_BOOT_CMD(
|
2008-10-16 13:01:15 +00:00
|
|
|
display, CONFIG_SYS_MAXARGS, 1, do_display,
|
2009-01-28 00:03:12 +00:00
|
|
|
"display string on dot matrix display",
|
2005-08-30 11:04:12 +00:00
|
|
|
"[<string>]\n"
|
|
|
|
" - with <string> argument: display <string> on dot matrix display\n"
|
2009-05-24 15:06:54 +00:00
|
|
|
" - without arguments: clear dot matrix display"
|
2005-08-30 11:04:12 +00:00
|
|
|
);
|