Blame view
cmd/display.c
966 Bytes
9f96ae44c
|
1 2 3 4 |
/* * (C) Copyright 2005 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * |
1a4596601
|
5 |
* SPDX-License-Identifier: GPL-2.0+ |
9f96ae44c
|
6 7 8 9 |
*/ #include <common.h> #include <command.h> |
7f0d241d5
|
10 |
#include <led-display.h> |
9f96ae44c
|
11 |
|
9f96ae44c
|
12 |
#undef DEBUG_DISP |
54841ab50
|
13 |
int do_display (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
9f96ae44c
|
14 15 |
{ int i; |
9f96ae44c
|
16 17 |
/* Clear display */ |
7f0d241d5
|
18 |
display_set(DISPLAY_CLEAR | DISPLAY_HOME); |
9f96ae44c
|
19 20 21 |
if (argc < 2) return (0); |
7f0d241d5
|
22 23 |
for (i = 1; i < argc; i++) { char *p = argv[i]; |
9f96ae44c
|
24 |
|
7f0d241d5
|
25 26 |
if (i > 1) { /* Insert a space between strings */ display_putc(' '); |
9f96ae44c
|
27 |
} |
7f0d241d5
|
28 |
while ((*p)) { |
9f96ae44c
|
29 |
#ifdef DEBUG_DISP |
7f0d241d5
|
30 |
putc(*p); |
9f96ae44c
|
31 |
#endif |
7f0d241d5
|
32 |
display_putc(*p++); |
9f96ae44c
|
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
} } #ifdef DEBUG_DISP putc(' '); #endif return (0); } /***************************************************/ U_BOOT_CMD( |
6d0f6bcf3
|
47 |
display, CONFIG_SYS_MAXARGS, 1, do_display, |
2fb2604d5
|
48 |
"display string on dot matrix display", |
9f96ae44c
|
49 50 51 52 |
"[<string>] " " - with <string> argument: display <string> on dot matrix display " |
a89c33db9
|
53 |
" - without arguments: clear dot matrix display" |
9f96ae44c
|
54 |
); |