summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorHannes Petermaier <hannes.petermaier@br-automation.com>2015-03-27 08:01:35 +0100
committerAnatolij Gustschin <agust@denx.de>2015-04-18 10:12:36 +0200
commit97562c12f1fac25a272a7079e234b9157eeedce5 (patch)
tree6b23bb159bc796cd337d4cf66d046a0ebd324452 /common
parent4564faeafbf11feb839e2e3f927be2f1a919ba96 (diff)
downloadu-boot-imx-97562c12f1fac25a272a7079e234b9157eeedce5.zip
u-boot-imx-97562c12f1fac25a272a7079e234b9157eeedce5.tar.gz
u-boot-imx-97562c12f1fac25a272a7079e234b9157eeedce5.tar.bz2
common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy
the capability of drawing some *str with count from lcd_drawchars is unnary. It is always called from lcd_putc_xy with one character of and count = 1. So we simply rename lcd_drawchars into lcd_putc_xy and remove the loops inside. Signed-off-by: Hannes Petermaier <hannes.petermaier@br-automation.com> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
Diffstat (limited to 'common')
-rw-r--r--common/lcd_console.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/common/lcd_console.c b/common/lcd_console.c
index 8bf83b9..243b7c5 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -55,18 +55,17 @@ int lcd_get_screen_columns(void)
return console_cols;
}
-static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
+static void lcd_putc_xy(ushort x, ushort y, char c)
{
uchar *dest;
ushort row;
int fg_color, bg_color;
+ int i;
dest = (uchar *)(lcd_console_address +
y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
- uchar *s = str;
- int i;
#if LCD_BPP == LCD_COLOR16
ushort *d = (ushort *)dest;
#elif LCD_BPP == LCD_COLOR32
@@ -77,25 +76,17 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
fg_color = lcd_getfgcolor();
bg_color = lcd_getbgcolor();
- for (i = 0; i < count; ++i) {
- uchar c, bits;
- c = *s++;
- bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
+ uchar bits;
+ bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
- for (c = 0; c < 8; ++c) {
- *d++ = (bits & 0x80) ? fg_color : bg_color;
- bits <<= 1;
- }
+ for (i = 0; i < 8; ++i) {
+ *d++ = (bits & 0x80) ? fg_color : bg_color;
+ bits <<= 1;
}
}
}
-static inline void lcd_putc_xy(ushort x, ushort y, uchar c)
-{
- lcd_drawchars(x, y, &c, 1);
-}
-
static void console_scrollup(void)
{
const int rows = CONFIG_CONSOLE_SCROLL_LINES;