[U-Boot] [RFC 1/4] common: add ansi console base implementation

Nikita Kiryanov nikita at compulab.co.il
Wed Mar 18 14:06:09 CET 2015


Hi Andrey,

On 03/14/2015 12:49 AM, Andrey Danin wrote:
> This code is based on ansi implementation in cfb_console.
> It is adopted to be used in lcd and cfb_console drivers.

Please describe what changes you have made (if any) from the original code.

>
> Signed-off-by: Andrey Danin <danindrey at mail.ru>
> ---
>   common/ansi_console.c  | 355 +++++++++++++++++++++++++++++++++++++++++++++++++
>   include/ansi_console.h |  39 ++++++
>   2 files changed, 394 insertions(+)
>   create mode 100644 common/ansi_console.c
>   create mode 100644 include/ansi_console.h
>

[...]

> +
> +static void console_putc(struct ansi_console_t *console, const char c)
> +{
> +	switch (c) {
> +	case '\r':		/* back to first column */
> +		console_caret_return(console);
> +		break;
> +
> +	case '\n':		/* next line */
> +		console_new_line(console, 1);
> +		break;
> +
> +	case '\t':		/* tab 8 */
> +		COL |= 0x0008;
> +		COL &= ~0x0007;

This seems buggy. Not only does this limit us to one tab, it can potentially move the cursor
backwards. The LCD version of COL += 8 seems more correct.

-- 
Regards,
Nikita Kiryanov


More information about the U-Boot mailing list