diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-08-10 20:27:03 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-08-10 20:27:03 +0000 |
commit | 7dc1e220d20710f711e69174682119413eebfd79 (patch) | |
tree | 12303eb1473f0e56c9c0d09f825e324d62f3f591 /firmware/panic.c | |
parent | e63f1ecb97085b7eb67ea1d54f736a074ee9701d (diff) | |
download | rockbox-7dc1e220d20710f711e69174682119413eebfd79.tar.gz rockbox-7dc1e220d20710f711e69174682119413eebfd79.zip |
panicf: Clear backdrop and print with black font on white background to prevent possible difficulties with reading it (especially on cabbiev2). Also start printing in the second row and column.
This fixes the second part of FS#10503 - "Menu and WPS backdrop not cleared when shutting down or during panic" (the first part is not a bug imo),
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22242 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/panic.c')
-rw-r--r-- | firmware/panic.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/firmware/panic.c b/firmware/panic.c index 0790835ac5..84bd30ae7b 100644 --- a/firmware/panic.c +++ b/firmware/panic.c | |||
@@ -59,16 +59,24 @@ void panicf( const char *fmt, ...) | |||
59 | lcd_puts(0, 0, "*PANIC*"); | 59 | lcd_puts(0, 0, "*PANIC*"); |
60 | lcd_puts(0, 1, panic_buf); | 60 | lcd_puts(0, 1, panic_buf); |
61 | #elif defined(HAVE_LCD_BITMAP) | 61 | #elif defined(HAVE_LCD_BITMAP) |
62 | int y = 1; | ||
63 | |||
64 | #ifdef LCD_DEPTH > 1 | ||
65 | lcd_set_backdrop(NULL); | ||
66 | lcd_set_foreground(LCD_BLACK); | ||
67 | lcd_set_background(LCD_WHITE); | ||
68 | #endif | ||
69 | |||
62 | lcd_clear_display(); | 70 | lcd_clear_display(); |
63 | lcd_setfont(FONT_SYSFIXED); | 71 | lcd_setfont(FONT_SYSFIXED); |
64 | lcd_puts(0, 0, (unsigned char *)"*PANIC*"); | 72 | lcd_puts(1, y++, (unsigned char *)"*PANIC*"); |
65 | { | 73 | { |
66 | /* wrap panic line */ | 74 | /* wrap panic line */ |
67 | int i, y=1, len = strlen(panic_buf); | 75 | int i, len = strlen(panic_buf); |
68 | for (i=0; i<len; i+=LINECHARS) { | 76 | for (i=0; i<len; i+=LINECHARS) { |
69 | unsigned char c = panic_buf[i+LINECHARS]; | 77 | unsigned char c = panic_buf[i+LINECHARS]; |
70 | panic_buf[i+LINECHARS] = 0; | 78 | panic_buf[i+LINECHARS] = 0; |
71 | lcd_puts(0, y++, (unsigned char *)panic_buf+i); | 79 | lcd_puts(1, y++, (unsigned char *)panic_buf+i); |
72 | panic_buf[i+LINECHARS] = c; | 80 | panic_buf[i+LINECHARS] = c; |
73 | } | 81 | } |
74 | } | 82 | } |