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:
parent
b8dc15f646
commit
5018ee264c
@ -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)
|
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
|
#if LV_USE_THEME_NIGHT
|
||||||
themes[i++] = lv_theme_night_init(hue, NULL);
|
themes[i++] = lv_theme_night_init(hue, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_THEME_MATERIAL
|
#if LV_USE_THEME_MATERIAL
|
||||||
themes[i++] = lv_theme_material_init(hue, NULL);
|
themes[i++] = lv_theme_material_init(hue, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_THEME_ALIEN
|
#if LV_USE_THEME_ALIEN
|
||||||
themes[i++] = lv_theme_alien_init(hue, NULL);
|
themes[i++] = lv_theme_alien_init(hue, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_THEME_ZEN
|
#if LV_USE_THEME_ZEN
|
||||||
themes[i++] = lv_theme_zen_init(hue, NULL);
|
themes[i++] = lv_theme_zen_init(hue, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_THEME_NEMO
|
#if LV_USE_THEME_NEMO
|
||||||
themes[i++] = lv_theme_nemo_init(hue, NULL);
|
themes[i++] = lv_theme_nemo_init(hue, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_THEME_MONO
|
#if LV_USE_THEME_MONO
|
||||||
themes[i++] = lv_theme_mono_init(hue, NULL);
|
themes[i++] = lv_theme_mono_init(hue, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_THEME_DEFAULT
|
#if LV_USE_THEME_DEFAULT
|
||||||
themes[i++] = lv_theme_default_init(hue, NULL);
|
themes[i++] = lv_theme_default_init(hue, NULL);
|
||||||
#endif
|
#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)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -62,6 +62,9 @@ WGET ?= wget
|
|||||||
LVGL_UNPACKNAME = lvgl
|
LVGL_UNPACKNAME = lvgl
|
||||||
UNPACK ?= unzip -o
|
UNPACK ?= unzip -o
|
||||||
|
|
||||||
|
PATCH_FILES = lv_fix_warning.patch
|
||||||
|
PATCH ?= patch -p0
|
||||||
|
|
||||||
LVGL_UNPACKDIR = $(WD)/$(LVGL_UNPACKNAME)
|
LVGL_UNPACKDIR = $(WD)/$(LVGL_UNPACKNAME)
|
||||||
|
|
||||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/littlevgl}
|
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/littlevgl}
|
||||||
@ -76,10 +79,13 @@ $(LVGL_UNPACKNAME): $(LVGL_TARBALL)
|
|||||||
$(Q) mv lvgl-$(LVGL_VERSION) $(LVGL_UNPACKNAME)
|
$(Q) mv lvgl-$(LVGL_VERSION) $(LVGL_UNPACKNAME)
|
||||||
$(Q) touch $(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)
|
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"
|
@echo "CP: lvgl/lvgl.h"
|
||||||
$(Q) cp lvgl/lvgl.h $(APPDIR)/include/graphics/lvgl.h
|
$(Q) cp lvgl/lvgl.h $(APPDIR)/include/graphics/lvgl.h
|
||||||
|
|
||||||
|
26
graphics/littlevgl/lv_fix_warning.patch
Normal file
26
graphics/littlevgl/lv_fix_warning.patch
Normal 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) {
|
Loading…
x
Reference in New Issue
Block a user