aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2015-02-05 00:20:37 +1000
committerinmarket <andrewh@inmarket.com.au>2015-02-05 00:20:37 +1000
commitf12e847c3040977b11de95d904b3f851a1f7d4a8 (patch)
tree1f8a568f382026f2c51319e77a09f908e10f0c19
parentada8d42f332c00da04ff78963ab48bb8cef25704 (diff)
downloaduGFX-f12e847c3040977b11de95d904b3f851a1f7d4a8.tar.gz
uGFX-f12e847c3040977b11de95d904b3f851a1f7d4a8.tar.bz2
uGFX-f12e847c3040977b11de95d904b3f851a1f7d4a8.zip
Fix compiler warnings for some drivers
-rw-r--r--src/gdisp/gdisp_driver.h51
1 files changed, 17 insertions, 34 deletions
diff --git a/src/gdisp/gdisp_driver.h b/src/gdisp/gdisp_driver.h
index 085e248f..7c4cafe8 100644
--- a/src/gdisp/gdisp_driver.h
+++ b/src/gdisp/gdisp_driver.h
@@ -1019,41 +1019,24 @@ typedef struct GDISPVMT {
* @note For use only by low level drivers
*/
#define gdispNative2Color(c) (c)
+ #elif COLOR_SYSTEM == GDISP_COLORSYSTEM_GRAYSCALE || LLDCOLOR_SYSTEM == GDISP_COLORSYSTEM_GRAYSCALE
+ #if GDISP_HARDWARE_USE_EXACT_COLOR
+ #define gdispColor2Native(c) LLDLUMA2COLOR(EXACT_LUMA_OF(c))
+ #define gdispNative2Color(c) LUMA2COLOR(LLDEXACT_LUMA_OF(c))
+ #else
+ #define gdispColor2Native(c) LLDLUMA2COLOR(LUMA_OF(c))
+ #define gdispNative2Color(c) LUMA2COLOR(LLDLUMA_OF(c))
+ #endif
+ #elif COLOR_SYSTEM == GDISP_COLORSYSTEM_TRUECOLOR && LLDCOLOR_SYSTEM == GDISP_COLORSYSTEM_TRUECOLOR
+ #if GDISP_HARDWARE_USE_EXACT_COLOR
+ #define gdispColor2Native(c) LLDRGB2COLOR(EXACT_RED_OF(c), EXACT_GREEN_OF(c), EXACT_BLUE_OF(c))
+ #define gdispNative2Color(c) RGB2COLOR(LLDEXACT_RED_OF(c), LLDEXACT_GREEN_OF(c), LLDEXACT_BLUE_OF(c))
+ #else
+ #define gdispColor2Native(c) LLDRGB2COLOR(RED_OF(c), GREEN_OF(c), BLUE_OF(c))
+ #define gdispNative2Color(c) RGB2COLOR(LLDRED_OF(c), LLDGREEN_OF(c), LLDBLUE_OF(c))
+ #endif
#else
- static LLDCOLOR_TYPE gdispColor2Native(color_t c) {
- #if COLOR_SYSTEM == GDISP_COLORSYSTEM_GRAYSCALE || LLDCOLOR_SYSTEM == GDISP_COLORSYSTEM_GRAYSCALE
- #if GDISP_HARDWARE_USE_EXACT_COLOR
- return LLDLUMA2COLOR(EXACT_LUMA_OF(c));
- #else
- return LLDLUMA2COLOR(LUMA_OF(c));
- #endif
- #elif COLOR_SYSTEM == GDISP_COLORSYSTEM_TRUECOLOR && LLDCOLOR_SYSTEM == GDISP_COLORSYSTEM_TRUECOLOR
- #if GDISP_HARDWARE_USE_EXACT_COLOR
- return LLDRGB2COLOR(EXACT_RED_OF(c), EXACT_GREEN_OF(c), EXACT_BLUE_OF(c));
- #else
- return LLDRGB2COLOR(RED_OF(c), GREEN_OF(c), BLUE_OF(c));
- #endif
- #else
- #error "GDISP: This pixel format conversion is not supported yet"
- #endif
- }
- static color_t gdispNative2Color(LLDCOLOR_TYPE c) {
- #if COLOR_SYSTEM == GDISP_COLORSYSTEM_GRAYSCALE || LLDCOLOR_SYSTEM == GDISP_COLORSYSTEM_GRAYSCALE
- #if GDISP_HARDWARE_USE_EXACT_COLOR
- return LUMA2COLOR(LLDEXACT_LUMA_OF(c));
- #else
- return LUMA2COLOR(LLDLUMA_OF(c));
- #endif
- #elif COLOR_SYSTEM == GDISP_COLORSYSTEM_TRUECOLOR && LLDCOLOR_SYSTEM == GDISP_COLORSYSTEM_TRUECOLOR
- #if GDISP_HARDWARE_USE_EXACT_COLOR
- return RGB2COLOR(LLDEXACT_RED_OF(c), LLDEXACT_GREEN_OF(c), LLDEXACT_BLUE_OF(c));
- #else
- return RGB2COLOR(LLDRED_OF(c), LLDGREEN_OF(c), LLDBLUE_OF(c));
- #endif
- #else
- #error "GDISP: This pixel format conversion is not supported yet"
- #endif
- }
+ #error "GDISP: This pixel format conversion is not supported yet"
#endif
#endif