From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Kiryanov Date: Wed, 18 Mar 2015 15:06:09 +0200 Subject: [U-Boot] [RFC 1/4] common: add ansi console base implementation In-Reply-To: <1426286965-18117-2-git-send-email-danindrey@mail.ru> References: <1426286965-18117-1-git-send-email-danindrey@mail.ru> <1426286965-18117-2-git-send-email-danindrey@mail.ru> Message-ID: <55097841.4060108@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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