summaryrefslogtreecommitdiffstats
path: root/firmware/logf.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/logf.c')
-rw-r--r--firmware/logf.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/firmware/logf.c b/firmware/logf.c
index fadfc9bb13..a24a635570 100644
--- a/firmware/logf.c
+++ b/firmware/logf.c
@@ -32,6 +32,7 @@
#include "config.h"
#include "system.h"
#include "font.h"
+#include "lcd.h"
#ifdef HAVE_REMOTE_LCD
#include "lcd-remote.h"
#endif
@@ -254,6 +255,54 @@ void _logf(const char *fmt, ...)
}
#endif
+void logf_panic_dump(int *y)
+{
+ int i;
+ /* nothing to print ? */
+ if(logfindex == 0 && !logfwrap)
+ {
+ lcd_puts(1, (*y)++, "no logf data");
+ lcd_update();
+ return;
+ }
+
+ lcd_puts(1, (*y)++, "start of logf data");
+ lcd_update();
+ i = logfindex - 2; /* The last actual characer (i.e. not '\0') */
+
+ while(i >= 0)
+ {
+ while(logfbuffer[i] != 0 && i>=0)
+ {
+ i--;
+ }
+ if(strlen( &logfbuffer[i + 1]) > 0)
+ {
+ lcd_puts(1, (*y)++, &logfbuffer[i + 1]);
+ lcd_update();
+ }
+ i--;
+ }
+ if(logfwrap)
+ {
+ i = MAX_LOGF_SIZE - 1;
+ while(i >= logfindex)
+ {
+ while(logfbuffer[i] != 0 && i >= logfindex)
+ {
+ i--;
+ }
+ if(strlen( &logfbuffer[i + 1]) > 0)
+ {
+ lcd_putsf(1, (*y)++, "%*s", (MAX_LOGF_SIZE-i) &logfbuffer[i + 1]);
+ lcd_update();
+ }
+ }
+ i--;
+ }
+ lcd_puts(1, (*y)++, "end of logf data");
+ lcd_update();
+}
#endif
#ifdef ROCKBOX_HAS_LOGDISKF