graphics/littlevgl: Fix lvgl internal warning with patch

examples/lvgldemo: Fix build warning with specific config

Signed-off-by: Qi Huang <huangqi3@xiaomi.com>
This commit is contained in:
Qi Huang 2020-04-16 10:00:58 +00:00 committed by Xiang Xiao
parent b8dc15f646
commit 5018ee264c
3 changed files with 46 additions and 10 deletions

View File

@ -448,33 +448,37 @@ static void hue_select_event_cb(lv_obj_t *roller, lv_event_t event)
static void init_all_themes(uint16_t hue)
{
int i = 0;
int i = 0;
/* Disalbe warning when no theme selected. */
UNUSED(i);
#if LV_USE_THEME_NIGHT
themes[i++] = lv_theme_night_init(hue, NULL);
themes[i++] = lv_theme_night_init(hue, NULL);
#endif
#if LV_USE_THEME_MATERIAL
themes[i++] = lv_theme_material_init(hue, NULL);
themes[i++] = lv_theme_material_init(hue, NULL);
#endif
#if LV_USE_THEME_ALIEN
themes[i++] = lv_theme_alien_init(hue, NULL);
themes[i++] = lv_theme_alien_init(hue, NULL);
#endif
#if LV_USE_THEME_ZEN
themes[i++] = lv_theme_zen_init(hue, NULL);
themes[i++] = lv_theme_zen_init(hue, NULL);
#endif
#if LV_USE_THEME_NEMO
themes[i++] = lv_theme_nemo_init(hue, NULL);
themes[i++] = lv_theme_nemo_init(hue, NULL);
#endif
#if LV_USE_THEME_MONO
themes[i++] = lv_theme_mono_init(hue, NULL);
themes[i++] = lv_theme_mono_init(hue, NULL);
#endif
#if LV_USE_THEME_DEFAULT
themes[i++] = lv_theme_default_init(hue, NULL);
themes[i++] = lv_theme_default_init(hue, NULL);
#endif
}
@ -492,7 +496,7 @@ static void init_all_themes(uint16_t hue)
static void bar_set_value(lv_obj_t *bar, int16_t value)
{
lv_bar_set_value(bar, value, LV_ANIM_OFF);
lv_bar_set_value(bar, value, LV_ANIM_OFF);
}
/****************************************************************************

View File

@ -62,6 +62,9 @@ WGET ?= wget
LVGL_UNPACKNAME = lvgl
UNPACK ?= unzip -o
PATCH_FILES = lv_fix_warning.patch
PATCH ?= patch -p0
LVGL_UNPACKDIR = $(WD)/$(LVGL_UNPACKNAME)
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/littlevgl}
@ -76,10 +79,13 @@ $(LVGL_UNPACKNAME): $(LVGL_TARBALL)
$(Q) mv lvgl-$(LVGL_VERSION) $(LVGL_UNPACKNAME)
$(Q) touch $(LVGL_UNPACKNAME)
$(LVGL_UNPACKNAME)/.patched: $(LVGL_UNPACKNAME) $(PATCH_FILES)
$(Q) cat $(PATCH_FILES) | $(PATCH)
$(Q) touch $(LVGL_UNPACKNAME)/.patched
lvgl/lvgl.h: $(LVGL_UNPACKNAME)
$(APPDIR)/include/graphics/lvgl.h: lvgl/lvgl.h
$(APPDIR)/include/graphics/lvgl.h: lvgl/lvgl.h $(LVGL_UNPACKNAME)/.patched
@echo "CP: lvgl/lvgl.h"
$(Q) cp lvgl/lvgl.h $(APPDIR)/include/graphics/lvgl.h

View File

@ -0,0 +1,26 @@
diff -ur lvgl-6.1.2/src/lv_draw/lv_draw_basic.c lvgl/src/lv_draw/lv_draw_basic.c
--- lvgl-6.1.2/src/lv_draw/lv_draw_basic.c 2020-02-26 22:35:12.000000000 +0000
+++ lvgl/src/lv_draw/lv_draw_basic.c 2020-04-16 09:24:53.015257341 +0000
@@ -530,7 +530,7 @@
else {
for(row = masked_a.y1; row <= masked_a.y2; row++) {
#if LV_USE_GPU
- if(disp->driver.gpu_blend_cb == false) {
+ if(disp->driver.gpu_blend_cb == NULL) {
sw_mem_blend(vdb_buf_tmp, (lv_color_t *)map_p, map_useful_w, opa);
} else {
disp->driver.gpu_blend_cb(&disp->driver, vdb_buf_tmp, (lv_color_t *)map_p, map_useful_w, opa);
diff -ur lvgl-6.1.2/src/lv_objx/lv_img.c lvgl/src/lv_objx/lv_img.c
--- lvgl-6.1.2/src/lv_objx/lv_img.c 2020-02-26 22:35:12.000000000 +0000
+++ lvgl/src/lv_objx/lv_img.c 2020-04-16 09:24:23.419691790 +0000
@@ -355,8 +355,8 @@
if(ext->cf == LV_IMG_CF_TRUE_COLOR || ext->cf == LV_IMG_CF_RAW) cover = lv_area_is_in(mask, &img->coords);
- const lv_style_t * style = lv_img_get_style(img, LV_IMG_STYLE_MAIN);
- if(style->image.opa < LV_OPA_MAX) return false;
+ const lv_style_t * style_ = lv_img_get_style(img, LV_IMG_STYLE_MAIN);
+ if(style_->image.opa < LV_OPA_MAX) return false;
return cover;
} else if(mode == LV_DESIGN_DRAW_MAIN) {