mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Update to lvgl 7.0 release
This commit is contained in:
parent
efe8efa2b0
commit
a19f15e68a
@ -7,6 +7,7 @@
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
|
#include "lv_core/lv_debug.h"
|
||||||
#include "lv_widgets/lv_canvas.h"
|
#include "lv_widgets/lv_canvas.h"
|
||||||
#include "lv_qrcode.h"
|
#include "lv_qrcode.h"
|
||||||
#include "qrcodegen.h"
|
#include "qrcodegen.h"
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <FS.h>
|
#include <FS.h>
|
||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
|
#include "lv_core/lv_debug.h"
|
||||||
#include "lv_zifont.h"
|
#include "lv_zifont.h"
|
||||||
#include "ArduinoLog.h"
|
#include "ArduinoLog.h"
|
||||||
|
|
||||||
@ -86,7 +87,7 @@ static inline bool openFont(File & file, const char * filename)
|
|||||||
|
|
||||||
static inline void initCharacterFrame(size_t size)
|
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);
|
if(charBitmap_p) lv_mem_free(charBitmap_p);
|
||||||
charBitmap_p = (uint8_t *)lv_mem_alloc(size);
|
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) {
|
if(!*font) {
|
||||||
*font = (lv_font_t *)lv_mem_alloc(sizeof(lv_font_t));
|
*font = (lv_font_t *)lv_mem_alloc(sizeof(lv_font_t));
|
||||||
LV_ASSERT_MEM(*font);
|
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;
|
lv_font_fmt_zifont_dsc_t * dsc;
|
||||||
if(!(*font)->dsc) {
|
if(!(*font)->dsc) {
|
||||||
dsc = (lv_font_fmt_zifont_dsc_t *)lv_mem_alloc(sizeof(lv_font_fmt_zifont_dsc_t));
|
dsc = (lv_font_fmt_zifont_dsc_t *)lv_mem_alloc(sizeof(lv_font_fmt_zifont_dsc_t));
|
||||||
LV_ASSERT_MEM(dsc);
|
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 {
|
} else {
|
||||||
dsc = (lv_font_fmt_zifont_dsc_t *)(*font)->dsc;
|
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 */
|
/* Initialize Last Glyph DSC */
|
||||||
dsc->last_glyph_dsc = (lv_zifont_char_t *)lv_mem_alloc(sizeof(lv_zifont_char_t));
|
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;
|
if(dsc->last_glyph_dsc == NULL) return ZIFONT_ERROR_OUT_OF_MEMORY;
|
||||||
dsc->last_glyph_dsc->width = 0;
|
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) {
|
if(!dsc->ascii_glyph_dsc) {
|
||||||
dsc->ascii_glyph_dsc = (lv_zifont_char_t *)lv_mem_alloc(sizeof(lv_zifont_char_t) * CHAR_CACHE_SIZE);
|
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_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
|
sizeof(lv_zifont_char_t) * CHAR_CACHE_SIZE); // lv_mem_alloc might be dirty
|
||||||
}
|
}
|
||||||
if(dsc->ascii_glyph_dsc == NULL) {
|
if(dsc->ascii_glyph_dsc == NULL) {
|
||||||
|
2
lib/lvgl
2
lib/lvgl
@ -1 +1 @@
|
|||||||
Subproject commit 5f739643f4b22254f5742504fcda3b7de50fb88b
|
Subproject commit d09924706048d3ac3fb8dc35f826405f65f07bb7
|
@ -475,13 +475,13 @@ void haspSetup()
|
|||||||
lv_style_set_text_font(&pagefont, LV_STATE_DEFAULT, defaultFont);
|
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);
|
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 */
|
/* Create all screens using the theme */
|
||||||
for(uint8_t i = 0; i < (sizeof pages / sizeof *pages); i++) {
|
for(uint8_t i = 0; i < (sizeof pages / sizeof *pages); i++) {
|
||||||
pages[i] = lv_obj_create(NULL, NULL);
|
pages[i] = lv_obj_create(NULL, NULL);
|
||||||
list = lv_obj_get_style_list(pages[i], LV_OBJ_PART_MAIN);
|
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);
|
// lv_obj_set_size(pages[0], hres, vres);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
#include "hasp.h"
|
#include "hasp.h"
|
||||||
|
#include "lv_core/lv_obj_style_dec.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
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); \
|
return lv_obj_set_style_local_##func_name(obj, part, state, (value_type)val); \
|
||||||
} else { \
|
} else { \
|
||||||
value_type temp; \
|
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); \
|
return hasp_out_int(obj, attr, temp); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user