Really fix yellow: Rename BMP_LINESIZE and BMP_BPP to get rid of the macro name collision

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28359 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sparmann 2010-10-25 12:52:02 +00:00
parent 7c6bb3f4ac
commit 77129ad3ec
3 changed files with 17 additions and 27 deletions

View file

@ -39,28 +39,18 @@
#define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff #define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff
#define LE32_CONST(x) (x)&0xff, ((x)>>8)&0xff, ((x)>>16)&0xff, ((x)>>24)&0xff #define LE32_CONST(x) (x)&0xff, ((x)>>8)&0xff, ((x)>>16)&0xff, ((x)>>24)&0xff
#ifndef BMP_BPP
#if LCD_DEPTH <= 4 #if LCD_DEPTH <= 4
#define BMP_BPP 4 #define DUMP_BMP_BPP 4
#define DUMP_BMP_LINESIZE ((LCD_WIDTH/2 + 3) & ~3)
#elif LCD_DEPTH <= 8 #elif LCD_DEPTH <= 8
#define BMP_BPP 8 #define DUMP_BMP_BPP 8
#define DUMP_BMP_LINESIZE ((LCD_WIDTH + 3) & ~3)
#elif LCD_DEPTH <= 16 #elif LCD_DEPTH <= 16
#define BMP_BPP 16 #define DUMP_BMP_BPP 16
#define DUMP_BMP_LINESIZE ((LCD_WIDTH*2 + 3) & ~3)
#else #else
#define BMP_BPP 24 #define DUMP_BMP_BPP 24
#endif #define DUMP_BMP_LINESIZE ((LCD_WIDTH*3 + 3) & ~3)
#endif
#ifndef BMP_LINESIZE
#if LCD_DEPTH <= 4
#define BMP_LINESIZE ((LCD_WIDTH/2 + 3) & ~3)
#elif LCD_DEPTH <= 8
#define BMP_LINESIZE ((LCD_WIDTH + 3) & ~3)
#elif LCD_DEPTH <= 16
#define BMP_LINESIZE ((LCD_WIDTH*2 + 3) & ~3)
#else
#define BMP_LINESIZE ((LCD_WIDTH*3 + 3) & ~3)
#endif
#endif #endif
#ifdef BOOTLOADER #ifdef BOOTLOADER

View file

@ -50,7 +50,7 @@
#endif /* LCD_DEPTH != 16 */ #endif /* LCD_DEPTH != 16 */
#define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS) #define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS)
#define BMP_DATASIZE (BMP_LINESIZE * (LCD_HEIGHT+LCD_SPLIT_LINES)) #define BMP_DATASIZE (DUMP_BMP_LINESIZE * (LCD_HEIGHT+LCD_SPLIT_LINES))
#define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE) #define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE)
static const unsigned char bmpheader[] = static const unsigned char bmpheader[] =
@ -64,7 +64,7 @@ static const unsigned char bmpheader[] =
LE32_CONST(LCD_WIDTH), /* Width in pixels */ LE32_CONST(LCD_WIDTH), /* Width in pixels */
LE32_CONST(LCD_HEIGHT+LCD_SPLIT_LINES), /* Height in pixels */ LE32_CONST(LCD_HEIGHT+LCD_SPLIT_LINES), /* Height in pixels */
0x01, 0x00, /* Number of planes (always 1) */ 0x01, 0x00, /* Number of planes (always 1) */
LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */ LE16_CONST(DUMP_BMP_BPP), /* Bits per pixel 1/4/8/16/24 */
LE32_CONST(BMP_COMPRESSION),/* Compression mode */ LE32_CONST(BMP_COMPRESSION),/* Compression mode */
LE32_CONST(BMP_DATASIZE), /* Size of bitmap data */ LE32_CONST(BMP_DATASIZE), /* Size of bitmap data */
0xc4, 0x0e, 0x00, 0x00, /* Horizontal resolution (pixels/meter) */ 0xc4, 0x0e, 0x00, 0x00, /* Horizontal resolution (pixels/meter) */
@ -113,10 +113,10 @@ void screen_dump(void)
#endif #endif
#if LCD_DEPTH <= 8 #if LCD_DEPTH <= 8
unsigned char *dst, *dst_end; unsigned char *dst, *dst_end;
unsigned char linebuf[BMP_LINESIZE]; unsigned char linebuf[DUMP_BMP_LINESIZE];
#elif LCD_DEPTH <= 16 #elif LCD_DEPTH <= 16
unsigned short *dst, *dst_end; unsigned short *dst, *dst_end;
unsigned short linebuf[BMP_LINESIZE/2]; unsigned short linebuf[DUMP_BMP_LINESIZE/2];
#endif #endif
#if CONFIG_RTC #if CONFIG_RTC
@ -141,13 +141,13 @@ void screen_dump(void)
/* BMP image goes bottom up */ /* BMP image goes bottom up */
for (y = LCD_HEIGHT - 1; y >= 0; y--) for (y = LCD_HEIGHT - 1; y >= 0; y--)
{ {
memset(linebuf, 0, BMP_LINESIZE); memset(linebuf, 0, DUMP_BMP_LINESIZE);
#if defined(HAVE_LCD_SPLIT) && (LCD_SPLIT_LINES == 2) #if defined(HAVE_LCD_SPLIT) && (LCD_SPLIT_LINES == 2)
if (y == LCD_SPLIT_POS - 1) if (y == LCD_SPLIT_POS - 1)
{ {
write(fd, linebuf, BMP_LINESIZE); write(fd, linebuf, DUMP_BMP_LINESIZE);
write(fd, linebuf, BMP_LINESIZE); write(fd, linebuf, DUMP_BMP_LINESIZE);
} }
#endif #endif
dst = linebuf; dst = linebuf;
@ -228,7 +228,7 @@ void screen_dump(void)
while (dst < dst_end); while (dst < dst_end);
#endif /* LCD_DEPTH */ #endif /* LCD_DEPTH */
write(fd, linebuf, BMP_LINESIZE); write(fd, linebuf, DUMP_BMP_LINESIZE);
} }
} }
close(fd); close(fd);

View file

@ -71,7 +71,7 @@ static int usb_mmc_countdown = 0;
/* Make sure there's enough stack space for screendump */ /* Make sure there's enough stack space for screendump */
#ifdef USB_FULL_INIT #ifdef USB_FULL_INIT
static long usb_stack[(DEFAULT_STACK_SIZE + SECTOR_SIZE + BMP_LINESIZE)/sizeof(long)]; static long usb_stack[(DEFAULT_STACK_SIZE + SECTOR_SIZE + DUMP_BMP_LINESIZE)/sizeof(long)];
static const char usb_thread_name[] = "usb"; static const char usb_thread_name[] = "usb";
static unsigned int usb_thread_entry = 0; static unsigned int usb_thread_entry = 0;
#ifndef USB_STATUS_BY_EVENT #ifndef USB_STATUS_BY_EVENT