From d6c87cb753ba1eaa5708f9f86b32bde0e384a27c Mon Sep 17 00:00:00 2001 From: Chris Mumford Date: Sat, 24 Oct 2020 11:49:55 -0700 Subject: [PATCH] Initialize lv_color_t::green_l when LV_COLOR_16_SWAP==1 (#1865) --- src/lv_misc/lv_color.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lv_misc/lv_color.h b/src/lv_misc/lv_color.h index cf4d135a0..b7d5e5299 100644 --- a/src/lv_misc/lv_color.h +++ b/src/lv_misc/lv_color.h @@ -267,7 +267,11 @@ typedef lv_color8_t lv_color_t; #elif LV_COLOR_DEPTH == 16 typedef uint16_t lv_color_int_t; typedef lv_color16_t lv_color_t; -#define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00}} +# if LV_COLOR_16_SWAP == 0 +# define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00}} +# else +# define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00, 0x00}} +# endif #elif LV_COLOR_DEPTH == 32 typedef uint32_t lv_color_int_t; typedef lv_color32_t lv_color_t;