summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-06-30 15:14:33 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-06-30 15:14:33 +0000
commit25b55e16bcf9bda35b770059bd8cfa7054893895 (patch)
treef85523638f368b11fc60f3b36e60bca167d71959 /firmware
parent65ff219e8e1133469750ca4d806d8f3b2cede442 (diff)
downloadrockbox-25b55e16bcf9bda35b770059bd8cfa7054893895.tar.gz
rockbox-25b55e16bcf9bda35b770059bd8cfa7054893895.zip
better logf
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6949 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/logf.h2
-rw-r--r--firmware/logf.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/firmware/export/logf.h b/firmware/export/logf.h
index 0d94d14156..70667fd52c 100644
--- a/firmware/export/logf.h
+++ b/firmware/export/logf.h
@@ -24,7 +24,7 @@
24#ifdef ROCKBOX_HAS_LOGF 24#ifdef ROCKBOX_HAS_LOGF
25 25
26#define MAX_LOGF_LINES 1000 26#define MAX_LOGF_LINES 1000
27#define MAX_LOGF_ENTRY 21 /* 128/6 pixels */ 27#define MAX_LOGF_ENTRY 256
28#define MAX_LOGF_DATASIZE (MAX_LOGF_ENTRY*MAX_LOGF_LINES) 28#define MAX_LOGF_DATASIZE (MAX_LOGF_ENTRY*MAX_LOGF_LINES)
29 29
30extern unsigned char logfbuffer[MAX_LOGF_LINES][MAX_LOGF_ENTRY]; 30extern unsigned char logfbuffer[MAX_LOGF_LINES][MAX_LOGF_ENTRY];
diff --git a/firmware/logf.c b/firmware/logf.c
index 0b4047f214..f61797b289 100644
--- a/firmware/logf.c
+++ b/firmware/logf.c
@@ -45,18 +45,19 @@ static void displayremote(void)
45 /* TODO: we should have a debug option that enables/disables this! */ 45 /* TODO: we should have a debug option that enables/disables this! */
46 int w, h; 46 int w, h;
47 int lines; 47 int lines;
48 int columns;
48 int i; 49 int i;
49 int index; 50 int index;
50 51
51 lcd_remote_getstringsize("A", &w, &h); 52 lcd_remote_getstringsize("A", &w, &h);
52 lines = LCD_REMOTE_HEIGHT/h; 53 lines = LCD_REMOTE_HEIGHT/h;
53 54 columns = LCD_REMOTE_WIDTH/w;
54 lcd_remote_setmargins(0, 0); 55 lcd_remote_setmargins(0, 0);
55 lcd_remote_clear_display(); 56 lcd_remote_clear_display();
56 57
57 index = logfindex; 58 index = logfindex;
58 for(i = lines-1; i>=0; i--) { 59 for(i = lines-1; i>=0; i--) {
59 unsigned char buffer[MAX_LOGF_ENTRY+1]; 60 unsigned char buffer[columns+1];
60 61
61 if(--index < 0) { 62 if(--index < 0) {
62 if(logfwrap) 63 if(logfwrap)
@@ -65,8 +66,8 @@ static void displayremote(void)
65 break; /* done */ 66 break; /* done */
66 } 67 }
67 68
68 memcpy(buffer, logfbuffer[index], MAX_LOGF_ENTRY); 69 memcpy(buffer, logfbuffer[index], columns);
69 buffer[MAX_LOGF_ENTRY]=0; 70 buffer[columns]=0;
70 lcd_remote_puts(0, i, buffer); 71 lcd_remote_puts(0, i, buffer);
71 } 72 }
72 lcd_remote_update(); 73 lcd_remote_update();