From a19f15e68ae0d052138f77757ec1e014f225cf5a Mon Sep 17 00:00:00 2001 From: fvanroie Date: Thu, 28 May 2020 14:53:39 +0200 Subject: [PATCH] Update to lvgl 7.0 release --- lib/lv_lib_qrcode/lv_qrcode.c | 1 + lib/lv_lib_zifont/lv_zifont.cpp | 11 ++++++----- lib/lvgl | 2 +- src/hasp.cpp | 4 ++-- src/hasp_attribute.h | 3 ++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/lv_lib_qrcode/lv_qrcode.c b/lib/lv_lib_qrcode/lv_qrcode.c index 5cf7625b..88651518 100644 --- a/lib/lv_lib_qrcode/lv_qrcode.c +++ b/lib/lv_lib_qrcode/lv_qrcode.c @@ -7,6 +7,7 @@ * INCLUDES *********************/ #include "lvgl.h" +#include "lv_core/lv_debug.h" #include "lv_widgets/lv_canvas.h" #include "lv_qrcode.h" #include "qrcodegen.h" diff --git a/lib/lv_lib_zifont/lv_zifont.cpp b/lib/lv_lib_zifont/lv_zifont.cpp index 829ae752..bf9c34c8 100644 --- a/lib/lv_lib_zifont/lv_zifont.cpp +++ b/lib/lv_lib_zifont/lv_zifont.cpp @@ -9,6 +9,7 @@ #include #include "lvgl.h" +#include "lv_core/lv_debug.h" #include "lv_zifont.h" #include "ArduinoLog.h" @@ -86,7 +87,7 @@ static inline bool openFont(File & file, const char * filename) static inline void initCharacterFrame(size_t size) { - if(size > lv_mem_get_size(charBitmap_p)) { + if(size > _lv_mem_get_size(charBitmap_p)) { if(charBitmap_p) lv_mem_free(charBitmap_p); charBitmap_p = (uint8_t *)lv_mem_alloc(size); } @@ -100,14 +101,14 @@ int lv_zifont_font_init(lv_font_t ** font, const char * font_path, uint16_t size if(!*font) { *font = (lv_font_t *)lv_mem_alloc(sizeof(lv_font_t)); LV_ASSERT_MEM(*font); - lv_memset(*font, 0x00, sizeof(lv_font_t)); // lv_mem_alloc might be dirty + _lv_memset(*font, 0x00, sizeof(lv_font_t)); // lv_mem_alloc might be dirty } lv_font_fmt_zifont_dsc_t * dsc; if(!(*font)->dsc) { dsc = (lv_font_fmt_zifont_dsc_t *)lv_mem_alloc(sizeof(lv_font_fmt_zifont_dsc_t)); LV_ASSERT_MEM(dsc); - lv_memset(dsc, 0x00, sizeof(lv_font_fmt_zifont_dsc_t)); // lv_mem_alloc might be dirty + _lv_memset(dsc, 0x00, sizeof(lv_font_fmt_zifont_dsc_t)); // lv_mem_alloc might be dirty } else { dsc = (lv_font_fmt_zifont_dsc_t *)(*font)->dsc; } @@ -116,7 +117,7 @@ int lv_zifont_font_init(lv_font_t ** font, const char * font_path, uint16_t size /* Initialize Last Glyph DSC */ dsc->last_glyph_dsc = (lv_zifont_char_t *)lv_mem_alloc(sizeof(lv_zifont_char_t)); - lv_memset(dsc->last_glyph_dsc, 0x00, sizeof(lv_zifont_char_t)); // lv_mem_alloc might be dirty + _lv_memset(dsc->last_glyph_dsc, 0x00, sizeof(lv_zifont_char_t)); // lv_mem_alloc might be dirty if(dsc->last_glyph_dsc == NULL) return ZIFONT_ERROR_OUT_OF_MEMORY; dsc->last_glyph_dsc->width = 0; @@ -155,7 +156,7 @@ int lv_zifont_font_init(lv_font_t ** font, const char * font_path, uint16_t size if(!dsc->ascii_glyph_dsc) { dsc->ascii_glyph_dsc = (lv_zifont_char_t *)lv_mem_alloc(sizeof(lv_zifont_char_t) * CHAR_CACHE_SIZE); LV_ASSERT_MEM(dsc->ascii_glyph_dsc); - lv_memset(dsc->ascii_glyph_dsc, 0x00, + _lv_memset(dsc->ascii_glyph_dsc, 0x00, sizeof(lv_zifont_char_t) * CHAR_CACHE_SIZE); // lv_mem_alloc might be dirty } if(dsc->ascii_glyph_dsc == NULL) { diff --git a/lib/lvgl b/lib/lvgl index 5f739643..d0992470 160000 --- a/lib/lvgl +++ b/lib/lvgl @@ -1 +1 @@ -Subproject commit 5f739643f4b22254f5742504fcda3b7de50fb88b +Subproject commit d09924706048d3ac3fb8dc35f826405f65f07bb7 diff --git a/src/hasp.cpp b/src/hasp.cpp index 481e06af..0cab0c84 100644 --- a/src/hasp.cpp +++ b/src/hasp.cpp @@ -475,13 +475,13 @@ void haspSetup() lv_style_set_text_font(&pagefont, LV_STATE_DEFAULT, defaultFont); list = lv_obj_get_style_list(lv_disp_get_layer_top(NULL), LV_OBJ_PART_MAIN); - lv_style_list_add_style(list, &pagefont); + _lv_style_list_add_style(list, &pagefont); /* Create all screens using the theme */ for(uint8_t i = 0; i < (sizeof pages / sizeof *pages); i++) { pages[i] = lv_obj_create(NULL, NULL); list = lv_obj_get_style_list(pages[i], LV_OBJ_PART_MAIN); - lv_style_list_add_style(list, &pagefont); + _lv_style_list_add_style(list, &pagefont); // lv_obj_set_size(pages[0], hres, vres); } diff --git a/src/hasp_attribute.h b/src/hasp_attribute.h index 6171e1e3..2d6763eb 100644 --- a/src/hasp_attribute.h +++ b/src/hasp_attribute.h @@ -3,6 +3,7 @@ #include "lvgl.h" #include "hasp.h" +#include "lv_core/lv_obj_style_dec.h" #ifdef __cplusplus extern "C" { @@ -29,7 +30,7 @@ bool check_obj_type(lv_obj_t * obj, lv_hasp_obj_type_t haspobjtype); return lv_obj_set_style_local_##func_name(obj, part, state, (value_type)val); \ } else { \ value_type temp; \ - lv_obj_get_style_local_##func_name(obj, part, state, &temp); \ + temp = lv_obj_get_style_##func_name(obj, part); \ return hasp_out_int(obj, attr, temp); \ } \ }