From: Kevin Townsend Date: Mon, 23 Jan 2012 22:44:24 +0000 (+0100) Subject: Cleaned up for RGB/BGR selection X-Git-Url: http://git.rohieb.name/hackover2013-badge-firmware.git/commitdiff_plain/6acd5c75b7ee5ccd0d09747661008e9edbb8945a Cleaned up for RGB/BGR selection --- diff --git a/drivers/lcd/tft/hw/ssd1331.c b/drivers/lcd/tft/hw/ssd1331.c index 73b9654..18d99ec 100644 --- a/drivers/lcd/tft/hw/ssd1331.c +++ b/drivers/lcd/tft/hw/ssd1331.c @@ -306,14 +306,14 @@ void lcdTest(void) { for(j=0;j<96;j++) { - if(i>55){DATA(invert565Color(COLOR_WHITE)>>8);DATA(invert565Color(COLOR_WHITE));} - else if(i>47){DATA(invert565Color(COLOR_BLUE)>>8);DATA(invert565Color(COLOR_BLUE));} - else if(i>39){DATA(invert565Color(COLOR_GREEN)>>8);DATA(invert565Color(COLOR_GREEN));} - else if(i>31){DATA(invert565Color(COLOR_CYAN)>>8);DATA(invert565Color(COLOR_CYAN));} - else if(i>23){DATA(invert565Color(COLOR_RED)>>8);DATA(invert565Color(COLOR_RED));} - else if(i>15){DATA(invert565Color(COLOR_MAGENTA)>>8);DATA(invert565Color(COLOR_MAGENTA));} - else if(i>7){DATA(invert565Color(COLOR_YELLOW)>>8);DATA(invert565Color(COLOR_YELLOW));} - else {DATA(invert565Color(COLOR_BLACK)>>8);DATA(invert565Color(COLOR_BLACK));} + if(i>55){DATA(COLOR_WHITE>>8);DATA(COLOR_WHITE);} + else if(i>47){DATA(COLOR_BLUE>>8);DATA(COLOR_BLUE);} + else if(i>39){DATA(COLOR_GREEN>>8);DATA(COLOR_GREEN);} + else if(i>31){DATA(COLOR_CYAN>>8);DATA(COLOR_CYAN);} + else if(i>23){DATA(COLOR_RED>>8);DATA(COLOR_RED);} + else if(i>15){DATA(COLOR_MAGENTA>>8);DATA(COLOR_MAGENTA);} + else if(i>7){DATA(COLOR_YELLOW>>8);DATA(COLOR_YELLOW);} + else {DATA(COLOR_BLACK>>8);DATA(COLOR_BLACK);} } } } @@ -325,7 +325,6 @@ void lcdTest(void) /**************************************************************************/ void lcdFillRGB(uint16_t data) { - data = invert565Color(data); ssd1331FillRect(0,0,ssd1331Properties.width-1,ssd1331Properties.height-1, data, data); } @@ -340,7 +339,6 @@ void lcdDrawPixel(uint16_t x, uint16_t y, uint16_t color) return; ssd1331SetCursor((uint8_t)x, (uint8_t)y); - color = invert565Color(color); DATA(color >> 8); DATA(color); } @@ -364,7 +362,6 @@ void lcdDrawPixels(uint16_t x, uint16_t y, uint16_t *data, uint32_t len) /**************************************************************************/ void lcdDrawHLine(uint16_t x0, uint16_t x1, uint16_t y, uint16_t color) { - color = invert565Color(color); ssd1331DrawLine((uint8_t)x0, (uint8_t)y, (uint8_t)x1, (uint8_t)y, color); } @@ -376,7 +373,6 @@ void lcdDrawHLine(uint16_t x0, uint16_t x1, uint16_t y, uint16_t color) /**************************************************************************/ void lcdDrawVLine(uint16_t x, uint16_t y0, uint16_t y1, uint16_t color) { - color = invert565Color(color); ssd1331DrawLine((uint8_t)x, (uint8_t)y0, (uint8_t)x, (uint8_t)y1, color); } diff --git a/drivers/lcd/tft/hw/ssd1331.h b/drivers/lcd/tft/hw/ssd1331.h index 8b53927..3dd4bc8 100644 --- a/drivers/lcd/tft/hw/ssd1331.h +++ b/drivers/lcd/tft/hw/ssd1331.h @@ -42,8 +42,8 @@ #include "core/gpio/gpio.h" // Select one of these defines to set the pixel color order -// #define SSD1331_COLORORDER_RGB -#define SSD1331_COLORORDER_BGR +#define SSD1331_COLORORDER_RGB +// #define SSD1331_COLORORDER_BGR #if defined SSD1331_COLORORDER_RGB && defined SSD1331_COLORORDER_BGR #error "RGB and BGR can not both be defined for SSD1331_COLORODER."