summaryrefslogtreecommitdiff
path: root/firmware/logf.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/logf.c')
-rw-r--r--firmware/logf.c9
1 files changed, 5 insertions, 4 deletions
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();