summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/lcd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index ba0e216990..6f7fef94ee 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -150,6 +150,9 @@ typedef void lcd_fastpixelfunc_type(fb_data *address);
150#define LCD_MAX_RED 31 150#define LCD_MAX_RED 31
151#define LCD_MAX_GREEN 63 151#define LCD_MAX_GREEN 63
152#define LCD_MAX_BLUE 31 152#define LCD_MAX_BLUE 31
153#define _RGB_UNPACK_RED(x) ((((x) >> 8) & 0xf8) | ((x) >> 13))
154#define _RGB_UNPACK_GREEN(x) ((((x) >> 3) & 0xfc) | (((x) >> 9) & 0x03))
155#define _RGB_UNPACK_BLUE(x) ((((x) << 3) & 0xf8) | (((x) >> 2) & 0x07))
153#define _RGBPACK(r, g, b) ( ((((r) * (31*257) + (127*257)) >> 16) << 11) \ 156#define _RGBPACK(r, g, b) ( ((((r) * (31*257) + (127*257)) >> 16) << 11) \
154 |((((g) * (63*257) + (127*257)) >> 16) << 5) \ 157 |((((g) * (63*257) + (127*257)) >> 16) << 5) \
155 | (((b) * (31*257) + (127*257)) >> 16)) 158 | (((b) * (31*257) + (127*257)) >> 16))
@@ -158,8 +161,14 @@ typedef void lcd_fastpixelfunc_type(fb_data *address);
158#if (LCD_PIXELFORMAT == RGB565SWAPPED) 161#if (LCD_PIXELFORMAT == RGB565SWAPPED)
159#define LCD_RGBPACK(r, g, b) ( ((_RGBPACK((r), (g), (b)) & 0xff00) >> 8) \ 162#define LCD_RGBPACK(r, g, b) ( ((_RGBPACK((r), (g), (b)) & 0xff00) >> 8) \
160 |((_RGBPACK((r), (g), (b)) & 0x00ff) << 8)) 163 |((_RGBPACK((r), (g), (b)) & 0x00ff) << 8))
164#define RGB_UNPACK_RED(x) _RGB_UNPACK_RED(swap16(x))
165#define RGB_UNPACK_GREEN(x) _RGB_UNPACK_GREEN(swap16(x))
166#define RGB_UNPACK_BLUE(x) _RGB_UNPACK_BLUE(swap16(x))
161#else 167#else
162#define LCD_RGBPACK(r, g, b) _RGBPACK((r), (g), (b)) 168#define LCD_RGBPACK(r, g, b) _RGBPACK((r), (g), (b))
169#define RGB_UNPACK_RED(x) _RGB_UNPACK_RED(x)
170#define RGB_UNPACK_GREEN(x) _RGB_UNPACK_GREEN(x)
171#define RGB_UNPACK_BLUE(x) _RGB_UNPACK_BLUE(x)
163#endif 172#endif
164#elif LCD_DEPTH == 18 173#elif LCD_DEPTH == 18
165#define LCD_MAX_RED 63 174#define LCD_MAX_RED 63