freemyipod r63 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r62‎ | r63 | r64 >
Date:05:59, 9 August 2010
Author:cmwslw
Status:new
Tags:
Comment:
Fixed the cprintf() bug where characters are printed one at a time.
Modified paths:
  • /embios/branches/4g_compat/console.c (modified) (history)
  • /embios/branches/4g_compat/lcdconsole.c (modified) (history)

Diff [purge]

Index: embios/branches/4g_compat/console.c
@@ -41,7 +41,7 @@
4242 static int cprfunc(void* ptr, unsigned char letter)
4343 {
4444 struct for_cprintf* pr = (struct for_cprintf*)ptr;
45 - cputc(pr->consoles, letter);
 45+ cputc_noblit(pr->consoles, letter);
4646 pr->bytes++;
4747 return true;
4848 }
@@ -57,6 +57,8 @@
5858 va_start(ap, fmt);
5959 format(cprfunc, &pr, fmt, ap);
6060 va_end(ap);
 61+
 62+ lcdconsole_update();
6163
6264 return pr.bytes;
6365 }
@@ -69,6 +71,8 @@
7072 pr.bytes = 0;
7173
7274 format(cprfunc, &pr, fmt, ap);
 75+
 76+ lcdconsole_update();
7377
7478 return pr.bytes;
7579 }
@@ -78,11 +82,21 @@
7983 if (consoles & 1) lcdconsole_putc(string, 0, -1);
8084 }
8185
 86+void cputc_noblit(unsigned int consoles, char string)
 87+{
 88+ if (consoles & 1) lcdconsole_putc_noblit(string, 0, -1);
 89+}
 90+
8291 void cputs(unsigned int consoles, const char* string)
8392 {
8493 if (consoles & 1) lcdconsole_puts(string, 0, -1);
8594 }
8695
 96+void cputs_noblit(unsigned int consoles, const char* string)
 97+{
 98+ if (consoles & 1) lcdconsole_puts_noblit(string, 0, -1);
 99+}
 100+
87101 void cflush(unsigned int consoles)
88102 {
89103 if (consoles & 1) lcdconsole_update();
Index: embios/branches/4g_compat/lcdconsole.c
@@ -50,7 +50,11 @@
5151
5252 void lcdconsole_putc_noblit(char string, int fgcolor, int bgcolor)
5353 {
54 - if (string == '\r') return;
 54+ if (string == '\r')
 55+ {
 56+ current_col = 0;
 57+ return;
 58+ }
5559 current_col++;
5660 if (string == '\n')
5761 {