diff options
Diffstat (limited to 'apps/misc.c')
-rw-r--r-- | apps/misc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/misc.c b/apps/misc.c index be1c3202fb..701f766a8d 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "sprintf.h" | 23 | #include "sprintf.h" |
24 | #include "errno.h" | 24 | #include "errno.h" |
25 | #include "system.h" | 25 | #include "system.h" |
26 | #include "timefuncs.h" | ||
26 | 27 | ||
27 | #define ONE_KILOBYTE 1024 | 28 | #define ONE_KILOBYTE 1024 |
28 | #define ONE_MEGABYTE (1024*1024) | 29 | #define ONE_MEGABYTE (1024*1024) |
@@ -102,7 +103,7 @@ int main(int argc, char **argv) | |||
102 | 103 | ||
103 | #endif | 104 | #endif |
104 | 105 | ||
105 | #ifdef SCREENDUMP | 106 | #ifdef HAVE_LCD_BITMAP |
106 | extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; | 107 | extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; |
107 | static unsigned char bmpheader[] = | 108 | static unsigned char bmpheader[] = |
108 | { | 109 | { |
@@ -117,7 +118,6 @@ static unsigned char bmpheader[] = | |||
117 | static unsigned char buf[112*8]; | 118 | static unsigned char buf[112*8]; |
118 | static unsigned char buf2[112*8]; | 119 | static unsigned char buf2[112*8]; |
119 | static char dummy[2] = {0, 0}; | 120 | static char dummy[2] = {0, 0}; |
120 | static int fileindex = 0; | ||
121 | 121 | ||
122 | void screen_dump(void) | 122 | void screen_dump(void) |
123 | { | 123 | { |
@@ -125,6 +125,7 @@ void screen_dump(void) | |||
125 | int i, shift; | 125 | int i, shift; |
126 | int x, y; | 126 | int x, y; |
127 | char filename[MAX_PATH]; | 127 | char filename[MAX_PATH]; |
128 | struct tm *tm = get_time(); | ||
128 | 129 | ||
129 | i = 0; | 130 | i = 0; |
130 | for(y = 0;y < LCD_HEIGHT/8;y++) | 131 | for(y = 0;y < LCD_HEIGHT/8;y++) |
@@ -151,7 +152,9 @@ void screen_dump(void) | |||
151 | } | 152 | } |
152 | } | 153 | } |
153 | 154 | ||
154 | snprintf(filename, MAX_PATH, "/dump%03d.bmp", fileindex++); | 155 | snprintf(filename, MAX_PATH, "/dump %04d-%02d-%02d %02d-%02d-%02d.bmp", |
156 | tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, | ||
157 | tm->tm_hour, tm->tm_min, tm->tm_sec); | ||
155 | f = creat(filename, O_WRONLY); | 158 | f = creat(filename, O_WRONLY); |
156 | if(f >= 0) | 159 | if(f >= 0) |
157 | { | 160 | { |