Skip to content
Snippets Groups Projects
Commit 8f47d917 authored by Nikita Kiryanov's avatar Nikita Kiryanov Committed by Anatolij Gustschin
Browse files

common lcd: minor coding style changes


No functional changes

Signed-off-by: default avatarNikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: default avatarIgor Grinberg <grinberg@compulab.co.il>
parent 211e4754
Branches
Tags
No related merge requests found
...@@ -121,8 +121,7 @@ static inline void console_back (void) ...@@ -121,8 +121,7 @@ static inline void console_back (void)
} }
lcd_putc_xy(console_col * VIDEO_FONT_WIDTH, lcd_putc_xy(console_col * VIDEO_FONT_WIDTH,
console_row * VIDEO_FONT_HEIGHT, console_row * VIDEO_FONT_HEIGHT, ' ');
' ');
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
...@@ -146,37 +145,37 @@ void lcd_putc (const char c) ...@@ -146,37 +145,37 @@ void lcd_putc (const char c)
{ {
if (!lcd_is_enabled) { if (!lcd_is_enabled) {
serial_putc(c); serial_putc(c);
return; return;
} }
switch (c) { switch (c) {
case '\r': console_col = 0; case '\r':
return; console_col = 0;
case '\n': console_newline();
return; return;
case '\n':
console_newline();
return;
case '\t': /* Tab (8 chars alignment) */ case '\t': /* Tab (8 chars alignment) */
console_col += 8; console_col += 8;
console_col &= ~7; console_col &= ~7;
if (console_col >= CONSOLE_COLS) { if (console_col >= CONSOLE_COLS)
console_newline(); console_newline();
}
return;
case '\b': console_back();
return; return;
case '\b':
console_back();
default: lcd_putc_xy (console_col * VIDEO_FONT_WIDTH,
console_row * VIDEO_FONT_HEIGHT,
c);
if (++console_col >= CONSOLE_COLS) {
console_newline();
}
return; return;
default:
lcd_putc_xy(console_col * VIDEO_FONT_WIDTH,
console_row * VIDEO_FONT_HEIGHT, c);
if (++console_col >= CONSOLE_COLS)
console_newline();
} }
/* NOTREACHED */
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
...@@ -185,6 +184,7 @@ void lcd_puts (const char *s) ...@@ -185,6 +184,7 @@ void lcd_puts (const char *s)
{ {
if (!lcd_is_enabled) { if (!lcd_is_enabled) {
serial_puts(s); serial_puts(s);
return; return;
} }
...@@ -447,8 +447,8 @@ ulong lcd_setmem (ulong addr) ...@@ -447,8 +447,8 @@ ulong lcd_setmem (ulong addr)
ulong size; ulong size;
int line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8; int line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8;
debug ("LCD panel info: %d x %d, %d bit/pix\n", debug("LCD panel info: %d x %d, %d bit/pix\n", panel_info.vl_col,
panel_info.vl_col, panel_info.vl_row, NBITS (panel_info.vl_bpix) ); panel_info.vl_row, NBITS(panel_info.vl_bpix));
size = line_length * panel_info.vl_row; size = line_length * panel_info.vl_row;
...@@ -460,7 +460,7 @@ ulong lcd_setmem (ulong addr) ...@@ -460,7 +460,7 @@ ulong lcd_setmem (ulong addr)
debug("Reserving %ldk for LCD Framebuffer at: %08lx\n", size>>10, addr); debug("Reserving %ldk for LCD Framebuffer at: %08lx\n", size>>10, addr);
return (addr); return addr;
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
...@@ -633,6 +633,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) ...@@ -633,6 +633,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
if (!((bmp->header.signature[0] == 'B') && if (!((bmp->header.signature[0] == 'B') &&
(bmp->header.signature[1] == 'M'))) { (bmp->header.signature[1] == 'M'))) {
printf("Error: no valid bmp image at %lx\n", bmp_image); printf("Error: no valid bmp image at %lx\n", bmp_image);
return 1; return 1;
} }
...@@ -646,6 +647,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) ...@@ -646,6 +647,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
if ((bpix != 1) && (bpix != 8) && (bpix != 16) && (bpix != 32)) { if ((bpix != 1) && (bpix != 8) && (bpix != 16) && (bpix != 32)) {
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n", printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
bpix, bmp_bpix); bpix, bmp_bpix);
return 1; return 1;
} }
...@@ -654,6 +656,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) ...@@ -654,6 +656,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n", printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
bpix, bpix,
le16_to_cpu(bmp->header.bit_count)); le16_to_cpu(bmp->header.bit_count));
return 1; return 1;
} }
...@@ -709,8 +712,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) ...@@ -709,8 +712,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
* specific. * specific.
*/ */
#if defined(CONFIG_MCC200) #if defined(CONFIG_MCC200)
if (bpix==1) if (bpix == 1) {
{
width = ((width + 7) & ~7) >> 3; width = ((width + 7) & ~7) >> 3;
x = ((x + 7) & ~7) >> 3; x = ((x + 7) & ~7) >> 3;
pwidth= ((pwidth + 7) & ~7) >> 3; pwidth= ((pwidth + 7) & ~7) >> 3;
...@@ -806,7 +808,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) ...@@ -806,7 +808,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
break; break;
}; };
return (0); return 0;
} }
#endif #endif
...@@ -823,13 +825,15 @@ static void *lcd_logo (void) ...@@ -823,13 +825,15 @@ static void *lcd_logo (void)
addr = simple_strtoul (s, NULL, 16); addr = simple_strtoul (s, NULL, 16);
#ifdef CONFIG_SPLASH_SCREEN_ALIGN #ifdef CONFIG_SPLASH_SCREEN_ALIGN
if ((s = getenv ("splashpos")) != NULL) { s = getenv("splashpos");
if (s != NULL) {
if (s[0] == 'm') if (s[0] == 'm')
x = BMP_ALIGN_CENTER; x = BMP_ALIGN_CENTER;
else else
x = simple_strtol(s, NULL, 0); x = simple_strtol(s, NULL, 0);
if ((s = strchr (s + 1, ',')) != NULL) { s = strchr(s + 1, ',');
if (s != NULL) {
if (s[1] == 'm') if (s[1] == 'm')
y = BMP_ALIGN_CENTER; y = BMP_ALIGN_CENTER;
else else
...@@ -848,9 +852,8 @@ static void *lcd_logo (void) ...@@ -848,9 +852,8 @@ static void *lcd_logo (void)
} }
#endif #endif
if (lcd_display_bitmap (addr, x, y) == 0) { if (lcd_display_bitmap(addr, x, y) == 0)
return ((void *)lcd_base); return (void *)lcd_base;
}
} }
#endif /* CONFIG_SPLASH_SCREEN */ #endif /* CONFIG_SPLASH_SCREEN */
...@@ -863,9 +866,9 @@ static void *lcd_logo (void) ...@@ -863,9 +866,9 @@ static void *lcd_logo (void)
#endif /* CONFIG_LCD_INFO */ #endif /* CONFIG_LCD_INFO */
#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO) #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
return ((void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length)); return (void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length);
#else #else
return ((void *)lcd_base); return (void *)lcd_base;
#endif /* CONFIG_LCD_LOGO && !CONFIG_LCD_INFO_BELOW_LOGO */ #endif /* CONFIG_LCD_LOGO && !CONFIG_LCD_INFO_BELOW_LOGO */
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment