better logf

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6949 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michiel Van Der Kolk 2005-06-30 15:14:33 +00:00
parent 65ff219e8e
commit 25b55e16bc
2 changed files with 6 additions and 5 deletions

View File

@ -24,7 +24,7 @@
#ifdef ROCKBOX_HAS_LOGF
#define MAX_LOGF_LINES 1000
#define MAX_LOGF_ENTRY 21 /* 128/6 pixels */
#define MAX_LOGF_ENTRY 256
#define MAX_LOGF_DATASIZE (MAX_LOGF_ENTRY*MAX_LOGF_LINES)
extern unsigned char logfbuffer[MAX_LOGF_LINES][MAX_LOGF_ENTRY];

View File

@ -45,18 +45,19 @@ static void displayremote(void)
/* TODO: we should have a debug option that enables/disables this! */
int w, h;
int lines;
int columns;
int i;
int index;
lcd_remote_getstringsize("A", &w, &h);
lines = LCD_REMOTE_HEIGHT/h;
columns = LCD_REMOTE_WIDTH/w;
lcd_remote_setmargins(0, 0);
lcd_remote_clear_display();
index = logfindex;
for(i = lines-1; i>=0; i--) {
unsigned char buffer[MAX_LOGF_ENTRY+1];
unsigned char buffer[columns+1];
if(--index < 0) {
if(logfwrap)
@ -65,8 +66,8 @@ static void displayremote(void)
break; /* done */
}
memcpy(buffer, logfbuffer[index], MAX_LOGF_ENTRY);
buffer[MAX_LOGF_ENTRY]=0;
memcpy(buffer, logfbuffer[index], columns);
buffer[columns]=0;
lcd_remote_puts(0, i, buffer);
}
lcd_remote_update();