aboutsummaryrefslogtreecommitdiffstats
path: root/boards/base/Linux-Framebuffer
diff options
context:
space:
mode:
authorinmarket <inmarket@ugfx.org>2016-08-24 17:47:32 +1000
committerinmarket <inmarket@ugfx.org>2016-08-24 17:47:32 +1000
commitbc336ee15fe5fbf732e82986be234afc85c4c56e (patch)
tree19300755ea79c77c698013638f588dff0919610e /boards/base/Linux-Framebuffer
parentb4f96b3e2659a93ccf96362b8e3a25ef90ae435b (diff)
downloaduGFX-bc336ee15fe5fbf732e82986be234afc85c4c56e.tar.gz
uGFX-bc336ee15fe5fbf732e82986be234afc85c4c56e.tar.bz2
uGFX-bc336ee15fe5fbf732e82986be234afc85c4c56e.zip
Fix for linux framebuffer for RGB555 and BGR555
Diffstat (limited to 'boards/base/Linux-Framebuffer')
-rw-r--r--boards/base/Linux-Framebuffer/board_framebuffer.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/boards/base/Linux-Framebuffer/board_framebuffer.h b/boards/base/Linux-Framebuffer/board_framebuffer.h
index c81e4d87..2417feda 100644
--- a/boards/base/Linux-Framebuffer/board_framebuffer.h
+++ b/boards/base/Linux-Framebuffer/board_framebuffer.h
@@ -96,7 +96,11 @@
fb_var.reserved[2] = 0;
fb_var.xoffset = 0;
fb_var.yoffset = 0;
- fb_var.bits_per_pixel = sizeof(LLDCOLOR_TYPE)*8;
+ #if LLDCOLOR_BITS == 15
+ fb_var.bits_per_pixel = LLDCOLOR_BITS; // Handle RGB555 & BGR555
+ #else
+ fb_var.bits_per_pixel = sizeof(LLDCOLOR_TYPE)*8;
+ #endif
fb_var.grayscale = 0;
fb_var.activate = FB_ACTIVATE_NOW;
if (ioctl(fb, FBIOPUT_VSCREENINFO, &fb_var) == -1 || ioctl (fb, FBIOGET_VSCREENINFO, &fb_var) == -1) {