diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/screendump.h | 26 | ||||
-rw-r--r-- | firmware/screendump.c | 16 | ||||
-rw-r--r-- | firmware/usb.c | 2 |
3 files changed, 17 insertions, 27 deletions
diff --git a/firmware/export/screendump.h b/firmware/export/screendump.h index b7acdd344c..484bc4dc7a 100644 --- a/firmware/export/screendump.h +++ b/firmware/export/screendump.h | |||
@@ -39,28 +39,18 @@ | |||
39 | #define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff | 39 | #define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff |
40 | #define LE32_CONST(x) (x)&0xff, ((x)>>8)&0xff, ((x)>>16)&0xff, ((x)>>24)&0xff | 40 | #define LE32_CONST(x) (x)&0xff, ((x)>>8)&0xff, ((x)>>16)&0xff, ((x)>>24)&0xff |
41 | 41 | ||
42 | #ifndef BMP_BPP | ||
43 | #if LCD_DEPTH <= 4 | 42 | #if LCD_DEPTH <= 4 |
44 | #define BMP_BPP 4 | 43 | #define DUMP_BMP_BPP 4 |
44 | #define DUMP_BMP_LINESIZE ((LCD_WIDTH/2 + 3) & ~3) | ||
45 | #elif LCD_DEPTH <= 8 | 45 | #elif LCD_DEPTH <= 8 |
46 | #define BMP_BPP 8 | 46 | #define DUMP_BMP_BPP 8 |
47 | #define DUMP_BMP_LINESIZE ((LCD_WIDTH + 3) & ~3) | ||
47 | #elif LCD_DEPTH <= 16 | 48 | #elif LCD_DEPTH <= 16 |
48 | #define BMP_BPP 16 | 49 | #define DUMP_BMP_BPP 16 |
50 | #define DUMP_BMP_LINESIZE ((LCD_WIDTH*2 + 3) & ~3) | ||
49 | #else | 51 | #else |
50 | #define BMP_BPP 24 | 52 | #define DUMP_BMP_BPP 24 |
51 | #endif | 53 | #define DUMP_BMP_LINESIZE ((LCD_WIDTH*3 + 3) & ~3) |
52 | #endif | ||
53 | |||
54 | #ifndef BMP_LINESIZE | ||
55 | #if LCD_DEPTH <= 4 | ||
56 | #define BMP_LINESIZE ((LCD_WIDTH/2 + 3) & ~3) | ||
57 | #elif LCD_DEPTH <= 8 | ||
58 | #define BMP_LINESIZE ((LCD_WIDTH + 3) & ~3) | ||
59 | #elif LCD_DEPTH <= 16 | ||
60 | #define BMP_LINESIZE ((LCD_WIDTH*2 + 3) & ~3) | ||
61 | #else | ||
62 | #define BMP_LINESIZE ((LCD_WIDTH*3 + 3) & ~3) | ||
63 | #endif | ||
64 | #endif | 54 | #endif |
65 | 55 | ||
66 | #ifdef BOOTLOADER | 56 | #ifdef BOOTLOADER |
diff --git a/firmware/screendump.c b/firmware/screendump.c index cd9d6a5bd6..30b9539732 100644 --- a/firmware/screendump.c +++ b/firmware/screendump.c | |||
@@ -50,7 +50,7 @@ | |||
50 | #endif /* LCD_DEPTH != 16 */ | 50 | #endif /* LCD_DEPTH != 16 */ |
51 | 51 | ||
52 | #define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS) | 52 | #define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS) |
53 | #define BMP_DATASIZE (BMP_LINESIZE * (LCD_HEIGHT+LCD_SPLIT_LINES)) | 53 | #define BMP_DATASIZE (DUMP_BMP_LINESIZE * (LCD_HEIGHT+LCD_SPLIT_LINES)) |
54 | #define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE) | 54 | #define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE) |
55 | 55 | ||
56 | static const unsigned char bmpheader[] = | 56 | static const unsigned char bmpheader[] = |
@@ -64,7 +64,7 @@ static const unsigned char bmpheader[] = | |||
64 | LE32_CONST(LCD_WIDTH), /* Width in pixels */ | 64 | LE32_CONST(LCD_WIDTH), /* Width in pixels */ |
65 | LE32_CONST(LCD_HEIGHT+LCD_SPLIT_LINES), /* Height in pixels */ | 65 | LE32_CONST(LCD_HEIGHT+LCD_SPLIT_LINES), /* Height in pixels */ |
66 | 0x01, 0x00, /* Number of planes (always 1) */ | 66 | 0x01, 0x00, /* Number of planes (always 1) */ |
67 | LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */ | 67 | LE16_CONST(DUMP_BMP_BPP), /* Bits per pixel 1/4/8/16/24 */ |
68 | LE32_CONST(BMP_COMPRESSION),/* Compression mode */ | 68 | LE32_CONST(BMP_COMPRESSION),/* Compression mode */ |
69 | LE32_CONST(BMP_DATASIZE), /* Size of bitmap data */ | 69 | LE32_CONST(BMP_DATASIZE), /* Size of bitmap data */ |
70 | 0xc4, 0x0e, 0x00, 0x00, /* Horizontal resolution (pixels/meter) */ | 70 | 0xc4, 0x0e, 0x00, 0x00, /* Horizontal resolution (pixels/meter) */ |
@@ -113,10 +113,10 @@ void screen_dump(void) | |||
113 | #endif | 113 | #endif |
114 | #if LCD_DEPTH <= 8 | 114 | #if LCD_DEPTH <= 8 |
115 | unsigned char *dst, *dst_end; | 115 | unsigned char *dst, *dst_end; |
116 | unsigned char linebuf[BMP_LINESIZE]; | 116 | unsigned char linebuf[DUMP_BMP_LINESIZE]; |
117 | #elif LCD_DEPTH <= 16 | 117 | #elif LCD_DEPTH <= 16 |
118 | unsigned short *dst, *dst_end; | 118 | unsigned short *dst, *dst_end; |
119 | unsigned short linebuf[BMP_LINESIZE/2]; | 119 | unsigned short linebuf[DUMP_BMP_LINESIZE/2]; |
120 | #endif | 120 | #endif |
121 | 121 | ||
122 | #if CONFIG_RTC | 122 | #if CONFIG_RTC |
@@ -141,13 +141,13 @@ void screen_dump(void) | |||
141 | /* BMP image goes bottom up */ | 141 | /* BMP image goes bottom up */ |
142 | for (y = LCD_HEIGHT - 1; y >= 0; y--) | 142 | for (y = LCD_HEIGHT - 1; y >= 0; y--) |
143 | { | 143 | { |
144 | memset(linebuf, 0, BMP_LINESIZE); | 144 | memset(linebuf, 0, DUMP_BMP_LINESIZE); |
145 | 145 | ||
146 | #if defined(HAVE_LCD_SPLIT) && (LCD_SPLIT_LINES == 2) | 146 | #if defined(HAVE_LCD_SPLIT) && (LCD_SPLIT_LINES == 2) |
147 | if (y == LCD_SPLIT_POS - 1) | 147 | if (y == LCD_SPLIT_POS - 1) |
148 | { | 148 | { |
149 | write(fd, linebuf, BMP_LINESIZE); | 149 | write(fd, linebuf, DUMP_BMP_LINESIZE); |
150 | write(fd, linebuf, BMP_LINESIZE); | 150 | write(fd, linebuf, DUMP_BMP_LINESIZE); |
151 | } | 151 | } |
152 | #endif | 152 | #endif |
153 | dst = linebuf; | 153 | dst = linebuf; |
@@ -228,7 +228,7 @@ void screen_dump(void) | |||
228 | while (dst < dst_end); | 228 | while (dst < dst_end); |
229 | 229 | ||
230 | #endif /* LCD_DEPTH */ | 230 | #endif /* LCD_DEPTH */ |
231 | write(fd, linebuf, BMP_LINESIZE); | 231 | write(fd, linebuf, DUMP_BMP_LINESIZE); |
232 | } | 232 | } |
233 | } | 233 | } |
234 | close(fd); | 234 | close(fd); |
diff --git a/firmware/usb.c b/firmware/usb.c index a76eb66fef..9eaf2014fa 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -71,7 +71,7 @@ static int usb_mmc_countdown = 0; | |||
71 | 71 | ||
72 | /* Make sure there's enough stack space for screendump */ | 72 | /* Make sure there's enough stack space for screendump */ |
73 | #ifdef USB_FULL_INIT | 73 | #ifdef USB_FULL_INIT |
74 | static long usb_stack[(DEFAULT_STACK_SIZE + SECTOR_SIZE + BMP_LINESIZE)/sizeof(long)]; | 74 | static long usb_stack[(DEFAULT_STACK_SIZE + SECTOR_SIZE + DUMP_BMP_LINESIZE)/sizeof(long)]; |
75 | static const char usb_thread_name[] = "usb"; | 75 | static const char usb_thread_name[] = "usb"; |
76 | static unsigned int usb_thread_entry = 0; | 76 | static unsigned int usb_thread_entry = 0; |
77 | #ifndef USB_STATUS_BY_EVENT | 77 | #ifndef USB_STATUS_BY_EVENT |