freemyipod r257 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r256‎ | r257 | r258 >
Date:20:53, 8 November 2010
Author:theseven
Status:new
Tags:
Comment:
emBIOS: Make LCD console default colors configurable
Modified paths:
  • /embios/trunk/console.c (modified) (history)
  • /embios/trunk/lcdconsole.c (modified) (history)
  • /embios/trunk/panic.c (modified) (history)
  • /embios/trunk/target/ipodnano2g/target.h (modified) (history)
  • /embios/trunk/target/ipodnano4g/target.h (modified) (history)

Diff [purge]

Index: embios/trunk/console.c
@@ -52,7 +52,7 @@
5353 void cputc_internal(unsigned int consoles, char string)
5454 {
5555 #ifdef HAVE_LCD
56 - if (consoles & 1) lcdconsole_putc(string, 0, -1);
 56+ if (consoles & 1) lcdconsole_putc(string, LCDCONSOLE_FGCOLOR, LCDCONSOLE_BGCOLOR);
5757 #endif
5858 #ifdef HAVE_USB
5959 if (consoles & 2) dbgconsole_putc(string);
@@ -109,7 +109,7 @@
110110 {
111111 mutex_lock(&console_mutex, TIMEOUT_BLOCK);
112112 #ifdef HAVE_LCD
113 - if (consoles & 1) lcdconsole_puts(string, 0, -1);
 113+ if (consoles & 1) lcdconsole_puts(string, LCDCONSOLE_FGCOLOR, LCDCONSOLE_BGCOLOR);
114114 #endif
115115 #ifdef HAVE_USB
116116 if (consoles & 2) dbgconsole_puts(string);
@@ -121,7 +121,7 @@
122122 {
123123 mutex_lock(&console_mutex, TIMEOUT_BLOCK);
124124 #ifdef HAVE_LCD
125 - if (consoles & 1) lcdconsole_write(string, length, 0, -1);
 125+ if (consoles & 1) lcdconsole_write(string, length, LCDCONSOLE_FGCOLOR, LCDCONSOLE_BGCOLOR);
126126 #endif
127127 #ifdef HAVE_USB
128128 if (consoles & 2) dbgconsole_write(string, length);
Index: embios/trunk/panic.c
@@ -57,9 +57,9 @@
5858 {
5959 enter_critical_section();
6060 while (!displaylcd_safe());
61 - lcdconsole_puts_noblit("\n*PANIC*\n", 0, -1);
62 - lcdconsole_puts_noblit(string, 0, -1);
63 - lcdconsole_puts_noblit("\n", 0, -1);
 61+ lcdconsole_puts_noblit("\n*PANIC*\n", LCDCONSOLE_FGCOLOR, LCDCONSOLE_BGCOLOR);
 62+ lcdconsole_puts_noblit(string, LCDCONSOLE_FGCOLOR, LCDCONSOLE_BGCOLOR);
 63+ lcdconsole_puts_noblit("\n", LCDCONSOLE_FGCOLOR, LCDCONSOLE_BGCOLOR);
6464 lcdconsole_update();
6565 hang();
6666 }
@@ -74,7 +74,7 @@
7575
7676 static int pprfunc(void* ptr, unsigned char letter)
7777 {
78 - lcdconsole_putc_noblit(letter, 0, -1);
 78+ lcdconsole_putc_noblit(letter, LCDCONSOLE_FGCOLOR, LCDCONSOLE_BGCOLOR);
7979 return true;
8080 }
8181
@@ -85,11 +85,11 @@
8686 {
8787 enter_critical_section();
8888 while (!displaylcd_safe());
89 - lcdconsole_puts_noblit("\n*PANIC*\n", 0, -1);
 89+ lcdconsole_puts_noblit("\n*PANIC*\n", LCDCONSOLE_FGCOLOR, LCDCONSOLE_BGCOLOR);
9090 va_start(ap, string);
9191 format(pprfunc, NULL, string, ap);
9292 va_end(ap);
93 - lcdconsole_puts_noblit("\n", 0, -1);
 93+ lcdconsole_puts_noblit("\n", LCDCONSOLE_FGCOLOR, LCDCONSOLE_BGCOLOR);
9494 lcdconsole_update();
9595 hang();
9696 }
Index: embios/trunk/target/ipodnano2g/target.h
@@ -47,6 +47,8 @@
4848 #define LCD_HEIGHT 132
4949 #define LCD_FORMAT rgb565
5050 #define LCD_BYTESPERPIXEL 2
 51+#define LCDCONSOLE_FGCOLOR 0
 52+#define LCDCONSOLE_BGCOLOR -1
5153
5254 #define HAVE_BACKLIGHT
5355
Index: embios/trunk/target/ipodnano4g/target.h
@@ -45,6 +45,8 @@
4646 #define LCD_HEIGHT 320
4747 #define LCD_FORMAT rgb565
4848 #define LCD_BYTESPERPIXEL 2
 49+#define LCDCONSOLE_FGCOLOR 0
 50+#define LCDCONSOLE_BGCOLOR -1
4951
5052 #define HAVE_BACKLIGHT
5153
Index: embios/trunk/lcdconsole.c
@@ -46,7 +46,7 @@
4747
4848 void lcdconsole_init()
4949 {
50 - memset(framebuf, -1, sizeof(framebuf));
 50+ memset(framebuf, LCDCONSOLE_BGCOLOR, sizeof(framebuf));
5151 current_row = 0;
5252 current_col = -1;
5353 lcdconsole_needs_update = false;