summaryrefslogtreecommitdiff
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 @@
32#include "config.h" 32#include "config.h"
33#include "system.h" 33#include "system.h"
34#include "font.h" 34#include "font.h"
35#include "lcd.h"
35#ifdef HAVE_REMOTE_LCD 36#ifdef HAVE_REMOTE_LCD
36#include "lcd-remote.h" 37#include "lcd-remote.h"
37#endif 38#endif
@@ -254,6 +255,54 @@ void _logf(const char *fmt, ...)
254} 255}
255#endif 256#endif
256 257
258void logf_panic_dump(int *y)
259{
260 int i;
261 /* nothing to print ? */
262 if(logfindex == 0 && !logfwrap)
263 {
264 lcd_puts(1, (*y)++, "no logf data");
265 lcd_update();
266 return;
267 }
268
269 lcd_puts(1, (*y)++, "start of logf data");
270 lcd_update();
271 i = logfindex - 2; /* The last actual characer (i.e. not '\0') */
272
273 while(i >= 0)
274 {
275 while(logfbuffer[i] != 0 && i>=0)
276 {
277 i--;
278 }
279 if(strlen( &logfbuffer[i + 1]) > 0)
280 {
281 lcd_puts(1, (*y)++, &logfbuffer[i + 1]);
282 lcd_update();
283 }
284 i--;
285 }
286 if(logfwrap)
287 {
288 i = MAX_LOGF_SIZE - 1;
289 while(i >= logfindex)
290 {
291 while(logfbuffer[i] != 0 && i >= logfindex)
292 {
293 i--;
294 }
295 if(strlen( &logfbuffer[i + 1]) > 0)
296 {
297 lcd_putsf(1, (*y)++, "%*s", (MAX_LOGF_SIZE-i) &logfbuffer[i + 1]);
298 lcd_update();
299 }
300 }
301 i--;
302 }
303 lcd_puts(1, (*y)++, "end of logf data");
304 lcd_update();
305}
257#endif 306#endif
258 307
259#ifdef ROCKBOX_HAS_LOGDISKF 308#ifdef ROCKBOX_HAS_LOGDISKF