add many LV_LOG_TRACE-s
This commit is contained in:
@@ -48,8 +48,9 @@
|
|||||||
# define LV_MEM_ADR 0 /*0: unused*/
|
# define LV_MEM_ADR 0 /*0: unused*/
|
||||||
#else /*LV_MEM_CUSTOM*/
|
#else /*LV_MEM_CUSTOM*/
|
||||||
# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
|
# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
|
||||||
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
|
# define LV_MEM_CUSTOM_ALLOC malloc
|
||||||
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
|
# define LV_MEM_CUSTOM_FREE free
|
||||||
|
# define LV_MEM_CUSTOM_REALLOC realloc
|
||||||
#endif /*LV_MEM_CUSTOM*/
|
#endif /*LV_MEM_CUSTOM*/
|
||||||
|
|
||||||
/* Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster). */
|
/* Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster). */
|
||||||
@@ -150,6 +151,11 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
|||||||
/* 1: Print the log with 'printf';
|
/* 1: Print the log with 'printf';
|
||||||
* 0: User need to register a callback with `lv_log_register_print_cb()`*/
|
* 0: User need to register a callback with `lv_log_register_print_cb()`*/
|
||||||
# define LV_LOG_PRINTF 1
|
# define LV_LOG_PRINTF 1
|
||||||
|
|
||||||
|
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs */
|
||||||
|
#define LV_LOG_TRACE_MEM 0
|
||||||
|
#define LV_LOG_TRACE_TIMER 0
|
||||||
|
|
||||||
#endif /*LV_USE_LOG*/
|
#endif /*LV_USE_LOG*/
|
||||||
|
|
||||||
/*-------------
|
/*-------------
|
||||||
@@ -199,8 +205,6 @@ typedef void * lv_user_data_t;
|
|||||||
#define LV_ENABLE_GC 0
|
#define LV_ENABLE_GC 0
|
||||||
#if LV_ENABLE_GC != 0
|
#if LV_ENABLE_GC != 0
|
||||||
# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
|
# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
|
||||||
# define LV_MEM_CUSTOM_REALLOC your_realloc /*Wrapper to realloc*/
|
|
||||||
# define LV_MEM_CUSTOM_GET_SIZE your_mem_get_size /*Wrapper to lv_mem_get_size*/
|
|
||||||
#endif /* LV_ENABLE_GC */
|
#endif /* LV_ENABLE_GC */
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
|
|||||||
@@ -244,6 +244,8 @@ static void flex_update(lv_obj_t * cont, lv_obj_t * item)
|
|||||||
if(cont->w_set == LV_SIZE_CONTENT || cont->h_set == LV_SIZE_CONTENT) {
|
if(cont->w_set == LV_SIZE_CONTENT || cont->h_set == LV_SIZE_CONTENT) {
|
||||||
lv_obj_set_size(cont, cont->w_set, cont->h_set);
|
lv_obj_set_size(cont, cont->w_set, cont->h_set);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -123,8 +123,11 @@ static void grid_update(lv_obj_t * cont, lv_obj_t * item)
|
|||||||
if(cont->spec_attr->layout_dsc == NULL) return;
|
if(cont->spec_attr->layout_dsc == NULL) return;
|
||||||
|
|
||||||
LV_LOG_INFO("Grid update on 0x%p. Triggered by 0x%p", cont, item);
|
LV_LOG_INFO("Grid update on 0x%p. Triggered by 0x%p", cont, item);
|
||||||
|
|
||||||
if(item) item_refr(item);
|
if(item) item_refr(item);
|
||||||
else full_refresh(cont);
|
else full_refresh(cont);
|
||||||
|
|
||||||
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ static void lv_spinbox_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
{
|
{
|
||||||
LV_UNUSED(copy);
|
LV_UNUSED(copy);
|
||||||
|
|
||||||
LV_LOG_TRACE("spinbox create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_spinbox_t * spinbox = (lv_spinbox_t *) obj;
|
lv_spinbox_t * spinbox = (lv_spinbox_t *) obj;
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ static void lv_spinbox_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
|
|
||||||
lv_spinbox_updatevalue(obj);
|
lv_spinbox_updatevalue(obj);
|
||||||
|
|
||||||
LV_LOG_INFO("spinbox created");
|
LV_LOG_TRACE("Spinbox constructor finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static lv_res_t lv_spinbox_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
|
static lv_res_t lv_spinbox_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
|
||||||
|
|||||||
@@ -130,14 +130,21 @@
|
|||||||
# ifdef CONFIG_LV_MEM_CUSTOM_ALLOC
|
# ifdef CONFIG_LV_MEM_CUSTOM_ALLOC
|
||||||
# define LV_MEM_CUSTOM_ALLOC CONFIG_LV_MEM_CUSTOM_ALLOC
|
# define LV_MEM_CUSTOM_ALLOC CONFIG_LV_MEM_CUSTOM_ALLOC
|
||||||
# else
|
# else
|
||||||
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
|
# define LV_MEM_CUSTOM_ALLOC malloc
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef LV_MEM_CUSTOM_FREE
|
#ifndef LV_MEM_CUSTOM_FREE
|
||||||
# ifdef CONFIG_LV_MEM_CUSTOM_FREE
|
# ifdef CONFIG_LV_MEM_CUSTOM_FREE
|
||||||
# define LV_MEM_CUSTOM_FREE CONFIG_LV_MEM_CUSTOM_FREE
|
# define LV_MEM_CUSTOM_FREE CONFIG_LV_MEM_CUSTOM_FREE
|
||||||
# else
|
# else
|
||||||
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
|
# define LV_MEM_CUSTOM_FREE free
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef LV_MEM_CUSTOM_REALLOC
|
||||||
|
# ifdef CONFIG_LV_MEM_CUSTOM_REALLOC
|
||||||
|
# define LV_MEM_CUSTOM_REALLOC CONFIG_LV_MEM_CUSTOM_REALLOC
|
||||||
|
# else
|
||||||
|
# define LV_MEM_CUSTOM_REALLOC realloc
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#endif /*LV_MEM_CUSTOM*/
|
#endif /*LV_MEM_CUSTOM*/
|
||||||
@@ -354,6 +361,23 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
|||||||
# define LV_LOG_PRINTF 1
|
# define LV_LOG_PRINTF 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs */
|
||||||
|
#ifndef LV_LOG_TRACE_MEM
|
||||||
|
# ifdef CONFIG_LV_LOG_TRACE_MEM
|
||||||
|
# define LV_LOG_TRACE_MEM CONFIG_LV_LOG_TRACE_MEM
|
||||||
|
# else
|
||||||
|
# define LV_LOG_TRACE_MEM 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef LV_LOG_TRACE_TIMER
|
||||||
|
# ifdef CONFIG_LV_LOG_TRACE_TIMER
|
||||||
|
# define LV_LOG_TRACE_TIMER CONFIG_LV_LOG_TRACE_TIMER
|
||||||
|
# else
|
||||||
|
# define LV_LOG_TRACE_TIMER 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /*LV_USE_LOG*/
|
#endif /*LV_USE_LOG*/
|
||||||
|
|
||||||
/*-------------
|
/*-------------
|
||||||
@@ -504,20 +528,6 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
|||||||
# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
|
# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef LV_MEM_CUSTOM_REALLOC
|
|
||||||
# ifdef CONFIG_LV_MEM_CUSTOM_REALLOC
|
|
||||||
# define LV_MEM_CUSTOM_REALLOC CONFIG_LV_MEM_CUSTOM_REALLOC
|
|
||||||
# else
|
|
||||||
# define LV_MEM_CUSTOM_REALLOC your_realloc /*Wrapper to realloc*/
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#ifndef LV_MEM_CUSTOM_GET_SIZE
|
|
||||||
# ifdef CONFIG_LV_MEM_CUSTOM_GET_SIZE
|
|
||||||
# define LV_MEM_CUSTOM_GET_SIZE CONFIG_LV_MEM_CUSTOM_GET_SIZE
|
|
||||||
# else
|
|
||||||
# define LV_MEM_CUSTOM_GET_SIZE your_mem_get_size /*Wrapper to lv_mem_get_size*/
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#endif /* LV_ENABLE_GC */
|
#endif /* LV_ENABLE_GC */
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
|
|||||||
@@ -104,11 +104,14 @@ void lv_group_del(lv_group_t * group)
|
|||||||
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
|
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
|
||||||
{
|
{
|
||||||
if(group == NULL) return;
|
if(group == NULL) return;
|
||||||
|
|
||||||
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
/*Do not add the object twice*/
|
/*Do not add the object twice*/
|
||||||
lv_obj_t ** obj_i;
|
lv_obj_t ** obj_i;
|
||||||
_LV_LL_READ(&group->obj_ll, obj_i) {
|
_LV_LL_READ(&group->obj_ll, obj_i) {
|
||||||
if((*obj_i) == obj) {
|
if((*obj_i) == obj) {
|
||||||
LV_LOG_INFO("lv_group_add_obj: the object is already added to this group");
|
LV_LOG_INFO("the object is already added to this group");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,7 +122,7 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
|
|||||||
if(obj->spec_attr->group_p && *(obj->spec_attr->group_p->obj_focus) == obj) {
|
if(obj->spec_attr->group_p && *(obj->spec_attr->group_p->obj_focus) == obj) {
|
||||||
lv_group_refocus(group_cur);
|
lv_group_refocus(group_cur);
|
||||||
|
|
||||||
LV_LOG_INFO("lv_group_add_obj: assign object to an other group");
|
LV_LOG_INFO("changing object's group");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,6 +139,8 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
|
|||||||
if(_lv_ll_get_head(&group->obj_ll) == next) {
|
if(_lv_ll_get_head(&group->obj_ll) == next) {
|
||||||
lv_group_refocus(group);
|
lv_group_refocus(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,6 +152,8 @@ void lv_group_remove_obj(lv_obj_t * obj)
|
|||||||
lv_group_t * g = lv_obj_get_group(obj);
|
lv_group_t * g = lv_obj_get_group(obj);
|
||||||
if(g == NULL) return;
|
if(g == NULL) return;
|
||||||
|
|
||||||
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
/*Focus on the next object*/
|
/*Focus on the next object*/
|
||||||
if(*g->obj_focus == obj) {
|
if(*g->obj_focus == obj) {
|
||||||
if(g->frozen) g->frozen = 0;
|
if(g->frozen) g->frozen = 0;
|
||||||
@@ -178,6 +185,7 @@ void lv_group_remove_obj(lv_obj_t * obj)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ static lv_obj_t * indev_obj_act = NULL;
|
|||||||
|
|
||||||
void lv_indev_read_task_cb(lv_timer_t * task)
|
void lv_indev_read_task_cb(lv_timer_t * task)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("indev read task started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_indev_data_t data;
|
lv_indev_data_t data;
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ void lv_indev_read_task_cb(lv_timer_t * task)
|
|||||||
indev_act = NULL;
|
indev_act = NULL;
|
||||||
indev_obj_act = NULL;
|
indev_obj_act = NULL;
|
||||||
|
|
||||||
LV_LOG_TRACE("indev read task finished");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_indev_enable(lv_indev_t * indev, bool en)
|
void lv_indev_enable(lv_indev_t * indev, bool en)
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ void lv_init(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_TRACE("lv_init started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
/*Initialize the lv_misc modules*/
|
/*Initialize the lv_misc modules*/
|
||||||
lv_mem_init();
|
lv_mem_init();
|
||||||
@@ -150,9 +150,9 @@ void lv_init(void)
|
|||||||
LV_LOG_WARN("Log level is set the Trace which makes LVGL much slower")
|
LV_LOG_WARN("Log level is set the Trace which makes LVGL much slower")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
lv_initialized = true;
|
lv_initialized = true;
|
||||||
LV_LOG_INFO("lv_init ready");
|
|
||||||
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_ENABLE_GC || !LV_MEM_CUSTOM
|
#if LV_ENABLE_GC || !LV_MEM_CUSTOM
|
||||||
@@ -546,10 +546,12 @@ bool lv_obj_is_valid(const lv_obj_t * obj)
|
|||||||
|
|
||||||
static void lv_obj_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_obj_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_obj_t * parent = obj->parent;
|
lv_obj_t * parent = obj->parent;
|
||||||
/*Create a screen*/
|
/*Create a screen*/
|
||||||
if(parent == NULL) {
|
if(parent == NULL) {
|
||||||
LV_LOG_TRACE("Screen create started");
|
LV_LOG_TRACE("creating a screen");
|
||||||
lv_disp_t * disp = lv_disp_get_default();
|
lv_disp_t * disp = lv_disp_get_default();
|
||||||
if(!disp) {
|
if(!disp) {
|
||||||
LV_LOG_WARN("No display created to so far. No place to assign the new screen");
|
LV_LOG_WARN("No display created to so far. No place to assign the new screen");
|
||||||
@@ -574,7 +576,7 @@ static void lv_obj_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
}
|
}
|
||||||
/*Create a normal object*/
|
/*Create a normal object*/
|
||||||
else {
|
else {
|
||||||
LV_LOG_TRACE("Object create started");
|
LV_LOG_TRACE("creating normal object");
|
||||||
LV_ASSERT_OBJ(parent, MY_CLASS);
|
LV_ASSERT_OBJ(parent, MY_CLASS);
|
||||||
if(parent->spec_attr == NULL) {
|
if(parent->spec_attr == NULL) {
|
||||||
lv_obj_allocate_spec_attr(parent);
|
lv_obj_allocate_spec_attr(parent);
|
||||||
@@ -646,7 +648,7 @@ static void lv_obj_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("Object create ready");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_obj_destructor(lv_obj_t * p)
|
static void lv_obj_destructor(lv_obj_t * p)
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ void _lv_refr_set_disp_refreshing(lv_disp_t * disp)
|
|||||||
*/
|
*/
|
||||||
void _lv_disp_refr_task(lv_timer_t * tmr)
|
void _lv_disp_refr_task(lv_timer_t * tmr)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("lv_refr_task: started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
uint32_t start = lv_tick_get();
|
uint32_t start = lv_tick_get();
|
||||||
uint32_t elaps = 0;
|
uint32_t elaps = 0;
|
||||||
@@ -197,6 +197,7 @@ void _lv_disp_refr_task(lv_timer_t * tmr)
|
|||||||
/*Do nothing if there is no active screen*/
|
/*Do nothing if there is no active screen*/
|
||||||
if(disp_refr->act_scr == NULL) {
|
if(disp_refr->act_scr == NULL) {
|
||||||
disp_refr->inv_p = 0;
|
disp_refr->inv_p = 0;
|
||||||
|
LV_LOG_TRACE("finished (there were no invalid areas to redraw)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +299,7 @@ void _lv_disp_refr_task(lv_timer_t * tmr)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LV_LOG_TRACE("lv_refr_task: ready");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_USE_PERF_MONITOR
|
#if LV_USE_PERF_MONITOR
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
|
|||||||
cached_src = &cache[i];
|
cached_src = &cache[i];
|
||||||
cached_src->life += cached_src->dec_dsc.time_to_open * LV_IMG_CACHE_LIFE_GAIN;
|
cached_src->life += cached_src->dec_dsc.time_to_open * LV_IMG_CACHE_LIFE_GAIN;
|
||||||
if(cached_src->life > LV_IMG_CACHE_LIFE_LIMIT) cached_src->life = LV_IMG_CACHE_LIFE_LIMIT;
|
if(cached_src->life > LV_IMG_CACHE_LIFE_LIMIT) cached_src->life = LV_IMG_CACHE_LIFE_LIMIT;
|
||||||
LV_LOG_TRACE("image draw: image found in the cache");
|
LV_LOG_TRACE("image source found in the cache");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,12 +151,11 @@ bool _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(indev->driver.read_cb) {
|
if(indev->driver.read_cb) {
|
||||||
LV_LOG_TRACE("indev read started");
|
LV_LOG_TRACE("calling indev_read_cb");
|
||||||
cont = indev->driver.read_cb(&indev->driver, data);
|
cont = indev->driver.read_cb(&indev->driver, data);
|
||||||
LV_LOG_TRACE("indev read finished");
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LV_LOG_WARN("indev function registered");
|
LV_LOG_WARN("indev_read_cb is not registered");
|
||||||
}
|
}
|
||||||
|
|
||||||
return cont;
|
return cont;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ void lv_anim_init(lv_anim_t * a)
|
|||||||
*/
|
*/
|
||||||
void lv_anim_start(lv_anim_t * a)
|
void lv_anim_start(lv_anim_t * a)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("animation create started")
|
LV_LOG_TRACE("begin");
|
||||||
/* Do not let two animations for the same 'var' with the same 'fp'*/
|
/* Do not let two animations for the same 'var' with the same 'fp'*/
|
||||||
if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); /*fp == NULL would delete all animations of var*/
|
if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); /*fp == NULL would delete all animations of var*/
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ void lv_anim_start(lv_anim_t * a)
|
|||||||
* It's important if it happens in a ready callback. (see `anim_task`)*/
|
* It's important if it happens in a ready callback. (see `anim_task`)*/
|
||||||
anim_mark_list_change();
|
anim_mark_list_change();
|
||||||
|
|
||||||
LV_LOG_TRACE("animation created")
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -553,7 +553,7 @@ lv_color_t lv_color_get_palette_accent_1(lv_color_palette_t palette)
|
|||||||
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_1();
|
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_1();
|
||||||
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_1();
|
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_1();
|
||||||
default:
|
default:
|
||||||
LV_LOG_INFO("Color palette %d has no accent colors, use main color instead", palette);
|
LV_LOG_WARN("color palette %d has no accent colors, use main color instead", palette);
|
||||||
return lv_color_get_palette_main(palette);
|
return lv_color_get_palette_main(palette);
|
||||||
}
|
}
|
||||||
return lv_color_black();
|
return lv_color_black();
|
||||||
@@ -579,7 +579,7 @@ lv_color_t lv_color_get_palette_accent_1(lv_color_palette_t palette)
|
|||||||
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_2();
|
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_2();
|
||||||
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_2();
|
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_2();
|
||||||
default:
|
default:
|
||||||
LV_LOG_INFO("Color palette %d has no accent colors, use main color instead", palette);
|
LV_LOG_WARN("color palette %d has no accent colors, use main color instead", palette);
|
||||||
return lv_color_get_palette_main(palette);
|
return lv_color_get_palette_main(palette);
|
||||||
}
|
}
|
||||||
return lv_color_black();
|
return lv_color_black();
|
||||||
@@ -605,7 +605,7 @@ lv_color_t lv_color_get_palette_accent_1(lv_color_palette_t palette)
|
|||||||
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_3();
|
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_3();
|
||||||
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_3();
|
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_3();
|
||||||
default:
|
default:
|
||||||
LV_LOG_INFO("Color palette %d has no accent colors, use main color instead", palette);
|
LV_LOG_WARN("color palette %d has no accent colors, use main color instead", palette);
|
||||||
return lv_color_get_palette_main(palette);
|
return lv_color_get_palette_main(palette);
|
||||||
}
|
}
|
||||||
return lv_color_black();
|
return lv_color_black();
|
||||||
@@ -631,7 +631,7 @@ lv_color_t lv_color_get_palette_accent_1(lv_color_palette_t palette)
|
|||||||
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_4();
|
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_4();
|
||||||
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_4();
|
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_4();
|
||||||
default:
|
default:
|
||||||
LV_LOG_INFO("Color palette %d has no accent colors, use main color instead", palette);
|
LV_LOG_WARN("color palette %d has no accent colors, use main color instead", palette);
|
||||||
return lv_color_get_palette_main(palette);
|
return lv_color_get_palette_main(palette);
|
||||||
}
|
}
|
||||||
return lv_color_black();
|
return lv_color_black();
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ void _lv_log_add(lv_log_level_t level, const char * file, int line, const char *
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t t = lv_tick_get();
|
uint32_t t = lv_tick_get();
|
||||||
static const char * lvl_prefix[] = {"Trace", "Info", "Warning", "Error", "User"};
|
static const char * lvl_prefix[] = {"Trace", "Info", "Warn", "Error", "User"};
|
||||||
printf("%s (%d.%03d): %s \t(%s #%d in %s())\n", lvl_prefix[level], t / 1000, t % 1000, buf, &file[p], line, func);
|
printf("[%s]\t(%d.%03d)\t %s: %s \t(in %s line #%d)\n", lvl_prefix[level], t / 1000, t % 1000, func, buf, &file[p], line);
|
||||||
#else
|
#else
|
||||||
if(custom_print_cb) custom_print_cb(level, file, line, func, buf);
|
if(custom_print_cb) custom_print_cb(level, file, line, func, buf);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include LV_MEM_CUSTOM_INCLUDE
|
#include LV_MEM_CUSTOM_INCLUDE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
@@ -98,6 +99,11 @@ static lv_mem_buf_t mem_buf_small[] = {{.p = mem_buf1_32, .size = MEM_BUF_SMALL_
|
|||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
#if LV_LOG_TRACE_MEM
|
||||||
|
# define MEM_TRACE(...) LV_LOG_TRACE( __VA_ARGS__)
|
||||||
|
#else
|
||||||
|
# define MEM_TRACE(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define COPY32 *d32 = *s32; d32++; s32++;
|
#define COPY32 *d32 = *s32; d32++; s32++;
|
||||||
#define COPY8 *d8 = *s8; d8++; s8++;
|
#define COPY8 *d8 = *s8; d8++; s8++;
|
||||||
@@ -157,7 +163,11 @@ void lv_mem_deinit(void)
|
|||||||
*/
|
*/
|
||||||
void * lv_mem_alloc(size_t size)
|
void * lv_mem_alloc(size_t size)
|
||||||
{
|
{
|
||||||
if(size == 0) return &zero_mem;
|
MEM_TRACE("allocating %d bytes", size);
|
||||||
|
if(size == 0) {
|
||||||
|
MEM_TRACE("using zero_mem");
|
||||||
|
return &zero_mem;
|
||||||
|
}
|
||||||
|
|
||||||
/*Round the size up to ALIGN_MASK*/
|
/*Round the size up to ALIGN_MASK*/
|
||||||
size = (size + ALIGN_MASK) & (~ALIGN_MASK);
|
size = (size + ALIGN_MASK) & (~ALIGN_MASK);
|
||||||
@@ -166,26 +176,14 @@ void * lv_mem_alloc(size_t size)
|
|||||||
#if LV_MEM_CUSTOM == 0
|
#if LV_MEM_CUSTOM == 0
|
||||||
alloc = alloc_core(size);
|
alloc = alloc_core(size);
|
||||||
if(alloc == NULL) {
|
if(alloc == NULL) {
|
||||||
LV_LOG_WARN("Out of memory, try to defrag");
|
LV_LOG_WARN("out of memory, trying to defrag");
|
||||||
lv_mem_defrag();
|
lv_mem_defrag();
|
||||||
alloc = alloc_core(size);
|
alloc = alloc_core(size);
|
||||||
LV_LOG_INFO("Defrag made enough memory");
|
LV_LOG_INFO("defrag made enough memory, memory allocated successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
/*Use custom, user defined malloc function*/
|
|
||||||
#if LV_ENABLE_GC == 1 /*gc must not include header*/
|
|
||||||
alloc = LV_MEM_CUSTOM_ALLOC(size);
|
alloc = LV_MEM_CUSTOM_ALLOC(size);
|
||||||
#else /* LV_ENABLE_GC */
|
|
||||||
/*Allocate a header too to store the size*/
|
|
||||||
alloc = LV_MEM_CUSTOM_ALLOC(size + sizeof(lv_mem_header_t));
|
|
||||||
if(alloc != NULL) {
|
|
||||||
((lv_mem_ent_t *)alloc)->header.s.d_size = size;
|
|
||||||
((lv_mem_ent_t *)alloc)->header.s.used = 1;
|
|
||||||
|
|
||||||
alloc = &((lv_mem_ent_t *)alloc)->first_data;
|
|
||||||
}
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
#endif /* LV_MEM_CUSTOM */
|
#endif /* LV_MEM_CUSTOM */
|
||||||
|
|
||||||
#if LV_MEM_ADD_JUNK
|
#if LV_MEM_ADD_JUNK
|
||||||
@@ -193,10 +191,10 @@ void * lv_mem_alloc(size_t size)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(alloc == NULL) {
|
if(alloc == NULL) {
|
||||||
LV_LOG_WARN("Couldn't allocate memory (%d bytes)", size);
|
LV_LOG_ERROR("couldn't allocate memory (%d bytes)", size);
|
||||||
lv_mem_monitor_t mon;
|
lv_mem_monitor_t mon;
|
||||||
lv_mem_monitor(&mon);
|
lv_mem_monitor(&mon);
|
||||||
LV_LOG_WARN("used: %6d (%3d %%), frag: %3d %%, biggest free: %6d",
|
LV_LOG_ERROR("used: %6d (%3d %%), frag: %3d %%, biggest free: %6d",
|
||||||
(int)mon.total_size - mon.free_size, mon.used_pct, mon.frag_pct,
|
(int)mon.total_size - mon.free_size, mon.used_pct, mon.frag_pct,
|
||||||
(int)mon.free_biggest_size);
|
(int)mon.free_biggest_size);
|
||||||
}
|
}
|
||||||
@@ -211,6 +209,7 @@ void * lv_mem_alloc(size_t size)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MEM_TRACE("allocated at 0x%p", alloc);
|
||||||
return alloc;
|
return alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,6 +219,7 @@ void * lv_mem_alloc(size_t size)
|
|||||||
*/
|
*/
|
||||||
void lv_mem_free(const void * data)
|
void lv_mem_free(const void * data)
|
||||||
{
|
{
|
||||||
|
MEM_TRACE("freeing 0x%p", data);
|
||||||
if(data == &zero_mem) return;
|
if(data == &zero_mem) return;
|
||||||
if(data == NULL) return;
|
if(data == NULL) return;
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ void lv_mem_free(const void * data)
|
|||||||
/*e points to the header*/
|
/*e points to the header*/
|
||||||
lv_mem_ent_t * e = (lv_mem_ent_t *)((uint8_t *)data - sizeof(lv_mem_header_t));
|
lv_mem_ent_t * e = (lv_mem_ent_t *)((uint8_t *)data - sizeof(lv_mem_header_t));
|
||||||
# if LV_MEM_ADD_JUNK
|
# if LV_MEM_ADD_JUNK
|
||||||
lv_memset((void *)data, 0xbb, lv_mem_get_size(data));
|
lv_memset((void *)data, 0xbb, e->header.s.d_size);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -237,16 +237,13 @@ void lv_mem_free(const void * data)
|
|||||||
static uint32_t defr = 0;
|
static uint32_t defr = 0;
|
||||||
defr++;
|
defr++;
|
||||||
if(defr > LV_MEM_FULL_DEFRAG_CNT) {
|
if(defr > LV_MEM_FULL_DEFRAG_CNT) {
|
||||||
|
LV_LOG_INFO("performing auto defrag")
|
||||||
defr = 0;
|
defr = 0;
|
||||||
lv_mem_defrag();
|
lv_mem_defrag();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#if LV_ENABLE_GC == 0
|
|
||||||
/*e points to the header*/
|
/*e points to the header*/
|
||||||
LV_MEM_CUSTOM_FREE(e);
|
LV_MEM_CUSTOM_FREE(data);
|
||||||
#else
|
|
||||||
LV_MEM_CUSTOM_FREE((void *)data);
|
|
||||||
#endif /*LV_ENABLE_GC*/
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,11 +254,20 @@ void lv_mem_free(const void * data)
|
|||||||
* @param new_size the desired new size in byte
|
* @param new_size the desired new size in byte
|
||||||
* @return pointer to the new memory
|
* @return pointer to the new memory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if LV_ENABLE_GC == 0
|
|
||||||
|
|
||||||
void * lv_mem_realloc(void * data_p, size_t new_size)
|
void * lv_mem_realloc(void * data_p, size_t new_size)
|
||||||
{
|
{
|
||||||
|
MEM_TRACE("reallocating 0x%p with %d size", data_p, new_size);
|
||||||
|
void * new_p = NULL;
|
||||||
|
#if LV_MEM_CUSTOM
|
||||||
|
new_p = LV_MEM_CUSTOM_REALLOC(data_p, new_size);
|
||||||
|
if(new_p == NULL) {
|
||||||
|
LV_LOG_ERROR("couldn't allocate memory");
|
||||||
|
return NULL;
|
||||||
|
} else {
|
||||||
|
MEM_TRACE("allocated at 0x%p", &e->first_data);
|
||||||
|
return new_p;
|
||||||
|
}
|
||||||
|
#else
|
||||||
/*Round the size up to ALIGN_MASK*/
|
/*Round the size up to ALIGN_MASK*/
|
||||||
new_size = (new_size + ALIGN_MASK) & (~ALIGN_MASK);
|
new_size = (new_size + ALIGN_MASK) & (~ALIGN_MASK);
|
||||||
|
|
||||||
@@ -273,10 +279,17 @@ void * lv_mem_realloc(void * data_p, size_t new_size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t old_size = lv_mem_get_size(data_p);
|
uint32_t old_size = 0;
|
||||||
if(old_size == new_size) return data_p; /*Also avoid reallocating the same memory*/
|
if(data_p) {
|
||||||
|
lv_mem_ent_t * e = (lv_mem_ent_t *)((uint8_t *)data_p - sizeof(lv_mem_header_t));
|
||||||
|
old_size = e->header.s.d_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(old_size == new_size) {
|
||||||
|
MEM_TRACE("same size, using the original memory");
|
||||||
|
return data_p;
|
||||||
|
}
|
||||||
|
|
||||||
#if LV_MEM_CUSTOM == 0
|
|
||||||
if(new_size == 0) {
|
if(new_size == 0) {
|
||||||
lv_mem_free(data_p);
|
lv_mem_free(data_p);
|
||||||
return &zero_mem;
|
return &zero_mem;
|
||||||
@@ -285,14 +298,13 @@ void * lv_mem_realloc(void * data_p, size_t new_size)
|
|||||||
if(new_size < old_size) {
|
if(new_size < old_size) {
|
||||||
lv_mem_ent_t * e = (lv_mem_ent_t *)((uint8_t *)data_p - sizeof(lv_mem_header_t));
|
lv_mem_ent_t * e = (lv_mem_ent_t *)((uint8_t *)data_p - sizeof(lv_mem_header_t));
|
||||||
ent_trunc(e, new_size);
|
ent_trunc(e, new_size);
|
||||||
|
MEM_TRACE("memory entry is truncated (same address 0x%p is used)", &e->first_data);
|
||||||
return &e->first_data;
|
return &e->first_data;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void * new_p;
|
|
||||||
new_p = lv_mem_alloc(new_size);
|
new_p = lv_mem_alloc(new_size);
|
||||||
if(new_p == NULL) {
|
if(new_p == NULL) {
|
||||||
LV_LOG_WARN("Couldn't allocate memory");
|
LV_LOG_ERROR("couldn't allocate memory");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,25 +316,17 @@ void * lv_mem_realloc(void * data_p, size_t new_size)
|
|||||||
lv_mem_free(data_p);
|
lv_mem_free(data_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MEM_TRACE("allocated at 0x%p", new_p);
|
||||||
return new_p;
|
return new_p;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
void * lv_mem_realloc(void * data_p, size_t new_size)
|
|
||||||
{
|
|
||||||
void * new_p = LV_MEM_CUSTOM_REALLOC(data_p, new_size);
|
|
||||||
if(new_p == NULL) LV_LOG_WARN("Couldn't allocate memory");
|
|
||||||
return new_p;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* lv_enable_gc */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join the adjacent free memory blocks
|
* Join the adjacent free memory blocks
|
||||||
*/
|
*/
|
||||||
void lv_mem_defrag(void)
|
void lv_mem_defrag(void)
|
||||||
{
|
{
|
||||||
|
MEM_TRACE("begin");
|
||||||
#if LV_MEM_CUSTOM == 0
|
#if LV_MEM_CUSTOM == 0
|
||||||
lv_mem_ent_t * e_free;
|
lv_mem_ent_t * e_free;
|
||||||
lv_mem_ent_t * e_next;
|
lv_mem_ent_t * e_next;
|
||||||
@@ -335,7 +339,10 @@ void lv_mem_defrag(void)
|
|||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(e_free == NULL) return;
|
if(e_free == NULL) {
|
||||||
|
MEM_TRACE("finished");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*Joint the following free entries to the free*/
|
/*Joint the following free entries to the free*/
|
||||||
e_next = ent_get_next(e_free);
|
e_next = ent_get_next(e_free);
|
||||||
@@ -350,7 +357,10 @@ void lv_mem_defrag(void)
|
|||||||
e_next = ent_get_next(e_next);
|
e_next = ent_get_next(e_next);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(e_next == NULL) return;
|
if(e_next == NULL) {
|
||||||
|
MEM_TRACE("finished");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*Continue from the lastly checked entry*/
|
/*Continue from the lastly checked entry*/
|
||||||
e_free = e_next;
|
e_free = e_next;
|
||||||
@@ -365,10 +375,12 @@ lv_res_t lv_mem_test(void)
|
|||||||
e = ent_get_next(NULL);
|
e = ent_get_next(NULL);
|
||||||
while(e) {
|
while(e) {
|
||||||
if(e->header.s.d_size > LV_MEM_SIZE) {
|
if(e->header.s.d_size > LV_MEM_SIZE) {
|
||||||
|
LV_LOG_WARN("failed");
|
||||||
return LV_RES_INV;
|
return LV_RES_INV;
|
||||||
}
|
}
|
||||||
uint8_t * e8 = (uint8_t *) e;
|
uint8_t * e8 = (uint8_t *) e;
|
||||||
if(e8 + e->header.s.d_size > work_mem + LV_MEM_SIZE) {
|
if(e8 + e->header.s.d_size > work_mem + LV_MEM_SIZE) {
|
||||||
|
LV_LOG_WARN("failed");
|
||||||
return LV_RES_INV;
|
return LV_RES_INV;
|
||||||
}
|
}
|
||||||
e = ent_get_next(e);
|
e = ent_get_next(e);
|
||||||
@@ -387,6 +399,7 @@ void lv_mem_monitor(lv_mem_monitor_t * mon_p)
|
|||||||
/*Init the data*/
|
/*Init the data*/
|
||||||
lv_memset(mon_p, 0, sizeof(lv_mem_monitor_t));
|
lv_memset(mon_p, 0, sizeof(lv_mem_monitor_t));
|
||||||
#if LV_MEM_CUSTOM == 0
|
#if LV_MEM_CUSTOM == 0
|
||||||
|
MEM_TRACE("begin");
|
||||||
lv_mem_ent_t * e;
|
lv_mem_ent_t * e;
|
||||||
|
|
||||||
e = ent_get_next(NULL);
|
e = ent_get_next(NULL);
|
||||||
@@ -415,35 +428,11 @@ void lv_mem_monitor(lv_mem_monitor_t * mon_p)
|
|||||||
else {
|
else {
|
||||||
mon_p->frag_pct = 0; /*no fragmentation if all the RAM is used*/
|
mon_p->frag_pct = 0; /*no fragmentation if all the RAM is used*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MEM_TRACE("finished");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Give the size of an allocated memory
|
|
||||||
* @param data pointer to an allocated memory
|
|
||||||
* @return the size of data memory in bytes
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if LV_ENABLE_GC == 0
|
|
||||||
|
|
||||||
uint32_t lv_mem_get_size(const void * data)
|
|
||||||
{
|
|
||||||
if(data == NULL) return 0;
|
|
||||||
if(data == &zero_mem) return 0;
|
|
||||||
|
|
||||||
lv_mem_ent_t * e = (lv_mem_ent_t *)((uint8_t *)data - sizeof(lv_mem_header_t));
|
|
||||||
|
|
||||||
return e->header.s.d_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
uint32_t lv_mem_get_size(const void * data)
|
|
||||||
{
|
|
||||||
return LV_MEM_CUSTOM_GET_SIZE(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /*LV_ENABLE_GC*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a temporal buffer with the given size.
|
* Get a temporal buffer with the given size.
|
||||||
@@ -453,12 +442,14 @@ void * lv_mem_buf_get(uint32_t size)
|
|||||||
{
|
{
|
||||||
if(size == 0) return NULL;
|
if(size == 0) return NULL;
|
||||||
|
|
||||||
|
MEM_TRACE("begin, getting %d bytes", size);
|
||||||
/*Try small static buffers first*/
|
/*Try small static buffers first*/
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
if(size <= MEM_BUF_SMALL_SIZE) {
|
if(size <= MEM_BUF_SMALL_SIZE) {
|
||||||
for(i = 0; i < sizeof(mem_buf_small) / sizeof(mem_buf_small[0]); i++) {
|
for(i = 0; i < sizeof(mem_buf_small) / sizeof(mem_buf_small[0]); i++) {
|
||||||
if(mem_buf_small[i].used == 0) {
|
if(mem_buf_small[i].used == 0) {
|
||||||
mem_buf_small[i].used = 1;
|
mem_buf_small[i].used = 1;
|
||||||
|
MEM_TRACE("return using small static buffer");
|
||||||
return mem_buf_small[i].p;
|
return mem_buf_small[i].p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -484,6 +475,7 @@ void * lv_mem_buf_get(uint32_t size)
|
|||||||
|
|
||||||
if(i_guess >= 0) {
|
if(i_guess >= 0) {
|
||||||
LV_GC_ROOT(lv_mem_buf[i_guess]).used = 1;
|
LV_GC_ROOT(lv_mem_buf[i_guess]).used = 1;
|
||||||
|
MEM_TRACE("returning already allocated buffer (buffer id: %d, address: 0x%p)", i_guess, LV_GC_ROOT(lv_mem_buf[i_guess]).p);
|
||||||
return LV_GC_ROOT(lv_mem_buf[i_guess]).p;
|
return LV_GC_ROOT(lv_mem_buf[i_guess]).p;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,14 +486,17 @@ void * lv_mem_buf_get(uint32_t size)
|
|||||||
void * buf = lv_mem_realloc(LV_GC_ROOT(lv_mem_buf[i]).p, size);
|
void * buf = lv_mem_realloc(LV_GC_ROOT(lv_mem_buf[i]).p, size);
|
||||||
LV_ASSERT_MSG(buf != NULL, "Out of memory, can't allocate a new buffer (increase your LV_MEM_SIZE/heap size)");
|
LV_ASSERT_MSG(buf != NULL, "Out of memory, can't allocate a new buffer (increase your LV_MEM_SIZE/heap size)");
|
||||||
if(buf == NULL) return NULL;
|
if(buf == NULL) return NULL;
|
||||||
|
|
||||||
LV_GC_ROOT(lv_mem_buf[i]).used = 1;
|
LV_GC_ROOT(lv_mem_buf[i]).used = 1;
|
||||||
LV_GC_ROOT(lv_mem_buf[i]).size = size;
|
LV_GC_ROOT(lv_mem_buf[i]).size = size;
|
||||||
LV_GC_ROOT(lv_mem_buf[i]).p = buf;
|
LV_GC_ROOT(lv_mem_buf[i]).p = buf;
|
||||||
|
MEM_TRACE("allocated (buffer id: %d, address: 0x%p)", i, LV_GC_ROOT(lv_mem_buf[i]).p);
|
||||||
return LV_GC_ROOT(lv_mem_buf[i]).p;
|
return LV_GC_ROOT(lv_mem_buf[i]).p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_ASSERT_MSG(false, "No free buffer. Increase LV_MEM_BUF_MAX_NUM.");
|
LV_LOG_ERROR("no more buffers. (increase LV_MEM_BUF_MAX_NUM)");
|
||||||
|
LV_ASSERT_MSG(false, "No more buffers. Increase LV_MEM_BUF_MAX_NUM.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,12 +506,14 @@ void * lv_mem_buf_get(uint32_t size)
|
|||||||
*/
|
*/
|
||||||
void lv_mem_buf_release(void * p)
|
void lv_mem_buf_release(void * p)
|
||||||
{
|
{
|
||||||
|
MEM_TRACE("begin (address: 0x%p)", p);
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
/*Try small static buffers first*/
|
/*Try small static buffers first*/
|
||||||
for(i = 0; i < sizeof(mem_buf_small) / sizeof(mem_buf_small[0]); i++) {
|
for(i = 0; i < sizeof(mem_buf_small) / sizeof(mem_buf_small[0]); i++) {
|
||||||
if(mem_buf_small[i].p == p) {
|
if(mem_buf_small[i].p == p) {
|
||||||
mem_buf_small[i].used = 0;
|
mem_buf_small[i].used = 0;
|
||||||
|
MEM_TRACE("released (buffer id: %d)", i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -528,7 +525,7 @@ void lv_mem_buf_release(void * p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_ERROR("lv_mem_buf_release: p is not a known buffer")
|
LV_LOG_ERROR("p is not a known buffer")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -113,12 +113,6 @@ lv_res_t lv_mem_test(void);
|
|||||||
*/
|
*/
|
||||||
void lv_mem_monitor(lv_mem_monitor_t * mon_p);
|
void lv_mem_monitor(lv_mem_monitor_t * mon_p);
|
||||||
|
|
||||||
/**
|
|
||||||
* Give the size of an allocated memory
|
|
||||||
* @param data pointer to an allocated memory
|
|
||||||
* @return the size of data memory in bytes
|
|
||||||
*/
|
|
||||||
uint32_t lv_mem_get_size(const void * data);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a temporal buffer with the given size.
|
* Get a temporal buffer with the given size.
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ static bool timer_created;
|
|||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
#if LV_LOG_TRACE_TIMER
|
||||||
|
# define TIMER_TRACE(...) LV_LOG_TRACE( __VA_ARGS__)
|
||||||
|
#else
|
||||||
|
# define TIMER_TRACE(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
@@ -60,7 +65,7 @@ void _lv_timer_core_init(void)
|
|||||||
*/
|
*/
|
||||||
LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void)
|
LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("lv_timer_handler started");
|
TIMER_TRACE("begin");
|
||||||
|
|
||||||
/*Avoid concurrent running of the timer handler*/
|
/*Avoid concurrent running of the timer handler*/
|
||||||
static bool already_running = false;
|
static bool already_running = false;
|
||||||
@@ -69,6 +74,7 @@ LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void)
|
|||||||
|
|
||||||
if(lv_timer_run == false) {
|
if(lv_timer_run == false) {
|
||||||
already_running = false; /*Release mutex*/
|
already_running = false; /*Release mutex*/
|
||||||
|
TIMER_TRACE("already running, concurrent calls are not allow, returning");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +97,7 @@ LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void)
|
|||||||
if(lv_timer_exec(LV_GC_ROOT(_lv_timer_act))) {
|
if(lv_timer_exec(LV_GC_ROOT(_lv_timer_act))) {
|
||||||
/*If a timer was created or deleted then this or the next item might be corrupted*/
|
/*If a timer was created or deleted then this or the next item might be corrupted*/
|
||||||
if(timer_created || timer_deleted) {
|
if(timer_created || timer_deleted) {
|
||||||
LV_LOG_TRACE("Start from the first timer again because a timer was created or deleted");
|
TIMER_TRACE("Start from the first timer again because a timer was created or deleted");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +129,7 @@ LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void)
|
|||||||
|
|
||||||
already_running = false; /*Release the mutex*/
|
already_running = false; /*Release the mutex*/
|
||||||
|
|
||||||
LV_LOG_TRACE("lv_timer_handler ready. %d ms until the next timer call", time_till_next);
|
TIMER_TRACE("finished (%d ms until the next timer call)", time_till_next);
|
||||||
return time_till_next;
|
return time_till_next;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -280,9 +286,9 @@ static bool lv_timer_exec(lv_timer_t * timer)
|
|||||||
bool exec = false;
|
bool exec = false;
|
||||||
if(lv_timer_time_remaining(timer) == 0) {
|
if(lv_timer_time_remaining(timer) == 0) {
|
||||||
timer->last_run = lv_tick_get();
|
timer->last_run = lv_tick_get();
|
||||||
LV_LOG_TRACE("Calling timer callback 0x%p", timer->timer_cb);
|
TIMER_TRACE("calling timer callback: 0x%p", timer->timer_cb);
|
||||||
if(timer->timer_cb) timer->timer_cb(timer);
|
if(timer->timer_cb) timer->timer_cb(timer);
|
||||||
LV_LOG_TRACE("Timer callback 0x%p finished", timer->timer_cb);
|
TIMER_TRACE("timer callback 0x%p finished", timer->timer_cb);
|
||||||
LV_ASSERT_MEM_INTEGRITY();
|
LV_ASSERT_MEM_INTEGRITY();
|
||||||
|
|
||||||
/*Delete if it was a one shot lv_timer*/
|
/*Delete if it was a one shot lv_timer*/
|
||||||
@@ -291,7 +297,7 @@ static bool lv_timer_exec(lv_timer_t * timer)
|
|||||||
timer->repeat_count--;
|
timer->repeat_count--;
|
||||||
}
|
}
|
||||||
if(timer->repeat_count == 0) {
|
if(timer->repeat_count == 0) {
|
||||||
LV_LOG_TRACE("Deleting timer with 0x%p callback because the repeat count is over", timer->timer_cb);
|
TIMER_TRACE("deleting timer with 0x%p callback because the repeat count is over", timer->timer_cb);
|
||||||
lv_timer_del(timer);
|
lv_timer_del(timer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ const lv_obj_class_t lv_arc_class = {
|
|||||||
*/
|
*/
|
||||||
lv_obj_t * lv_arc_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_arc_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_arc_class, parent, copy);
|
return lv_obj_create_from_class(&lv_arc_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,10 +483,9 @@ lv_arc_type_t lv_arc_get_type(const lv_obj_t * obj)
|
|||||||
|
|
||||||
static void lv_arc_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_arc_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("lv_arc create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_arc_t * arc = (lv_arc_t *)obj;
|
lv_arc_t * arc = (lv_arc_t *)obj;
|
||||||
LV_LOG_TRACE("arc create started");
|
|
||||||
|
|
||||||
/*Initialize the allocated 'ext' */
|
/*Initialize the allocated 'ext' */
|
||||||
arc->rotation = 0;
|
arc->rotation = 0;
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ const lv_obj_class_t lv_bar_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_bar_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_bar_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_bar_class, parent, copy);
|
return lv_obj_create_from_class(&lv_bar_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +202,7 @@ lv_bar_type_t lv_bar_get_type(lv_obj_t * obj)
|
|||||||
|
|
||||||
static void lv_bar_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_bar_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("lv_bar create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_bar_t * bar = (lv_bar_t *)obj;
|
lv_bar_t * bar = (lv_bar_t *)obj;
|
||||||
bar->min_value = 0;
|
bar->min_value = 0;
|
||||||
@@ -228,7 +229,7 @@ static void lv_bar_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
|
|
||||||
lv_bar_set_value(obj, bar->cur_value, LV_ANIM_OFF);
|
lv_bar_set_value(obj, bar->cur_value, LV_ANIM_OFF);
|
||||||
}
|
}
|
||||||
LV_LOG_INFO("bar created");
|
LV_LOG_TRACE("finshed");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_bar_destructor(lv_obj_t * obj)
|
static void lv_bar_destructor(lv_obj_t * obj)
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ const lv_obj_class_t lv_btn_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_btn_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_btn_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_btn_class, parent, copy);
|
return lv_obj_create_from_class(&lv_btn_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ lv_obj_t * lv_btn_create(lv_obj_t * parent, const lv_obj_t * copy)
|
|||||||
|
|
||||||
static void lv_btn_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_btn_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("lv_btn create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
if(copy == NULL) {
|
if(copy == NULL) {
|
||||||
lv_obj_set_size(obj, LV_DPI_DEF, LV_DPI_DEF / 3);
|
lv_obj_set_size(obj, LV_DPI_DEF, LV_DPI_DEF / 3);
|
||||||
@@ -60,7 +61,7 @@ static void lv_btn_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
|
lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("btn created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ const lv_obj_class_t lv_btnmatrix_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_btnmatrix_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_btnmatrix_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_btnmatrix_class, parent, copy);
|
return lv_obj_create_from_class(&lv_btnmatrix_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,8 +378,7 @@ static void lv_btnmatrix_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
lv_btnmatrix_set_ctrl_map(obj, copy_btnm->ctrl_bits);
|
lv_btnmatrix_set_ctrl_map(obj, copy_btnm->ctrl_bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_LOG_TRACE("finshed");
|
||||||
LV_LOG_INFO("button matrix created");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_btnmatrix_destructor(lv_obj_t * obj)
|
static void lv_btnmatrix_destructor(lv_obj_t * obj)
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ const lv_obj_class_t lv_canvas_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_canvas_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_canvas_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_canvas_class, parent, copy);
|
return lv_obj_create_from_class(&lv_canvas_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -894,7 +895,7 @@ void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_
|
|||||||
static void lv_canvas_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_canvas_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_UNUSED(copy);
|
LV_UNUSED(copy);
|
||||||
LV_LOG_TRACE("canvas create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_canvas_t * canvas = (lv_canvas_t *) obj;
|
lv_canvas_t * canvas = (lv_canvas_t *) obj;
|
||||||
|
|
||||||
@@ -908,7 +909,7 @@ static void lv_canvas_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
|
|
||||||
lv_img_set_src(obj, &canvas->dsc);
|
lv_img_set_src(obj, &canvas->dsc);
|
||||||
|
|
||||||
LV_LOG_INFO("canvas created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_set_px_cb(lv_disp_drv_t * disp_drv, lv_img_cf_t cf)
|
static void set_set_px_cb(lv_disp_drv_t * disp_drv, lv_img_cf_t cf)
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ const lv_obj_class_t lv_chart_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_chart_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_chart_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_chart_class, parent, copy);
|
return lv_obj_create_from_class(&lv_chart_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,6 +326,8 @@ void lv_chart_refresh(lv_obj_t * obj)
|
|||||||
|
|
||||||
lv_chart_series_t * lv_chart_add_series(lv_obj_t * obj, lv_color_t color, lv_chart_axis_t axis)
|
lv_chart_series_t * lv_chart_add_series(lv_obj_t * obj, lv_color_t color, lv_chart_axis_t axis)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
|
|
||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
|
|
||||||
if(axis != LV_CHART_AXIS_PRIMARY_Y && axis != LV_CHART_AXIS_SECONDARY_Y) {
|
if(axis != LV_CHART_AXIS_PRIMARY_Y && axis != LV_CHART_AXIS_SECONDARY_Y) {
|
||||||
@@ -493,7 +496,7 @@ int32_t lv_chart_get_pressed_point(const lv_obj_t * obj)
|
|||||||
|
|
||||||
static void lv_chart_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_chart_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("chart create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_chart_t * chart = (lv_chart_t *) obj;
|
lv_chart_t * chart = (lv_chart_t *) obj;
|
||||||
|
|
||||||
@@ -527,7 +530,7 @@ static void lv_chart_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
lv_memcpy_small(chart->ymin, chart_copy->ymin, sizeof(chart->ymin));
|
lv_memcpy_small(chart->ymin, chart_copy->ymin, sizeof(chart->ymin));
|
||||||
lv_memcpy_small(chart->ymax, chart_copy->ymax, sizeof(chart->ymax));
|
lv_memcpy_small(chart->ymax, chart_copy->ymax, sizeof(chart->ymax));
|
||||||
}
|
}
|
||||||
LV_LOG_INFO("chart created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_chart_destructor(lv_obj_t * obj)
|
static void lv_chart_destructor(lv_obj_t * obj)
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ const lv_obj_class_t lv_checkbox_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_checkbox_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_checkbox_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_checkbox_class, parent, copy);
|
return lv_obj_create_from_class(&lv_checkbox_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +111,7 @@ const char * lv_checkbox_get_text(const lv_obj_t * obj)
|
|||||||
|
|
||||||
static void lv_checkbox_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_checkbox_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("lv_checkbox create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_checkbox_t * cb = (lv_checkbox_t *) obj;
|
lv_checkbox_t * cb = (lv_checkbox_t *) obj;
|
||||||
|
|
||||||
@@ -126,7 +127,7 @@ static void lv_checkbox_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
// const lv_checkbox_t * copy_ext = (const lv_checkbox_t *)copy;
|
// const lv_checkbox_t * copy_ext = (const lv_checkbox_t *)copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("lv_checkbox created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_checkbox_destructor(lv_obj_t * obj)
|
static void lv_checkbox_destructor(lv_obj_t * obj)
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ const lv_obj_class_t lv_dropdown_list_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_dropdown_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_dropdown_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_dropdown_class, parent, copy);
|
return lv_obj_create_from_class(&lv_dropdown_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,7 +534,7 @@ static lv_obj_t * lv_dropdown_list_create(lv_obj_t * parent, const lv_obj_t * co
|
|||||||
|
|
||||||
static void lv_dropdown_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_dropdown_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("dropdown create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_dropdown_t * dropdown = (lv_dropdown_t *) obj;
|
lv_dropdown_t * dropdown = (lv_dropdown_t *) obj;
|
||||||
|
|
||||||
@@ -573,7 +574,7 @@ static void lv_dropdown_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
// dropdown->dir = copy_dropdown->dir;
|
// dropdown->dir = copy_dropdown->dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("dropdown created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_dropdown_destructor(lv_obj_t * obj)
|
static void lv_dropdown_destructor(lv_obj_t * obj)
|
||||||
@@ -765,9 +766,13 @@ static lv_draw_res_t lv_dropdown_list_draw(lv_obj_t * list_obj, const lv_area_t
|
|||||||
|
|
||||||
static void lv_dropdown_list_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_dropdown_list_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
LV_UNUSED(copy);
|
LV_UNUSED(copy);
|
||||||
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
|
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
|
||||||
lv_label_create(obj, NULL);
|
lv_label_create(obj, NULL);
|
||||||
|
|
||||||
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_dropdown_list_destructor(lv_obj_t * list_obj)
|
static void lv_dropdown_list_destructor(lv_obj_t * list_obj)
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ const lv_obj_class_t lv_img_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_img_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_img_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_img_class, parent, copy);
|
return lv_obj_create_from_class(&lv_img_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,8 +104,6 @@ void lv_img_set_src(lv_obj_t * obj, const void * src)
|
|||||||
|
|
||||||
/*Save the source*/
|
/*Save the source*/
|
||||||
if(src_type == LV_IMG_SRC_VARIABLE) {
|
if(src_type == LV_IMG_SRC_VARIABLE) {
|
||||||
LV_LOG_INFO("lv_img_set_src: `LV_IMG_SRC_VARIABLE` type found");
|
|
||||||
|
|
||||||
/*If memory was allocated because of the previous `src_type` then free it*/
|
/*If memory was allocated because of the previous `src_type` then free it*/
|
||||||
if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_SYMBOL) {
|
if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_SYMBOL) {
|
||||||
lv_mem_free(img->src);
|
lv_mem_free(img->src);
|
||||||
@@ -362,7 +361,7 @@ bool lv_img_get_antialias(lv_obj_t * obj)
|
|||||||
|
|
||||||
static void lv_img_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_img_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("lv_bar create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_img_t * img = (lv_img_t *)obj;
|
lv_img_t * img = (lv_img_t *)obj;
|
||||||
|
|
||||||
@@ -397,6 +396,8 @@ static void lv_img_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
img->pivot = copy_img->pivot;
|
img->pivot = copy_img->pivot;
|
||||||
lv_img_set_src(obj, copy_img->src);
|
lv_img_set_src(obj, copy_img->src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_img_destructor(lv_obj_t * obj)
|
static void lv_img_destructor(lv_obj_t * obj)
|
||||||
@@ -499,8 +500,6 @@ static lv_draw_res_t lv_img_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv
|
|||||||
img_max_area.y2 -= pbottom;
|
img_max_area.y2 -= pbottom;
|
||||||
|
|
||||||
if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_VARIABLE) {
|
if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_VARIABLE) {
|
||||||
LV_LOG_TRACE("lv_img_draw: start to draw image");
|
|
||||||
|
|
||||||
lv_draw_img_dsc_t img_dsc;
|
lv_draw_img_dsc_t img_dsc;
|
||||||
lv_draw_img_dsc_init(&img_dsc);
|
lv_draw_img_dsc_init(&img_dsc);
|
||||||
lv_obj_init_draw_img_dsc(obj, LV_PART_MAIN, &img_dsc);
|
lv_obj_init_draw_img_dsc(obj, LV_PART_MAIN, &img_dsc);
|
||||||
@@ -535,7 +534,6 @@ static lv_draw_res_t lv_img_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(img->src_type == LV_IMG_SRC_SYMBOL) {
|
else if(img->src_type == LV_IMG_SRC_SYMBOL) {
|
||||||
LV_LOG_TRACE("lv_img_draw: start to draw symbol");
|
|
||||||
lv_draw_label_dsc_t label_dsc;
|
lv_draw_label_dsc_t label_dsc;
|
||||||
lv_draw_label_dsc_init(&label_dsc);
|
lv_draw_label_dsc_init(&label_dsc);
|
||||||
lv_obj_init_draw_label_dsc(obj, LV_PART_MAIN, &label_dsc);
|
lv_obj_init_draw_label_dsc(obj, LV_PART_MAIN, &label_dsc);
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ const lv_obj_class_t lv_label_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_label_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_label_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_label_class, parent, copy);
|
return lv_obj_create_from_class(&lv_label_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -694,7 +695,7 @@ void lv_label_cut_text(lv_obj_t * obj, uint32_t pos, uint32_t cnt)
|
|||||||
|
|
||||||
static void lv_label_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_label_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("label create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_label_t * label = (lv_label_t *)obj;
|
lv_label_t * label = (lv_label_t *)obj;
|
||||||
|
|
||||||
@@ -725,7 +726,7 @@ static void lv_label_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
lv_label_set_text(obj, "Text");
|
lv_label_set_text(obj, "Text");
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("label created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_label_destructor(lv_obj_t * obj)
|
static void lv_label_destructor(lv_obj_t * obj)
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ const lv_obj_class_t lv_line_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_line_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_line_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_line_class, parent, copy);
|
return lv_obj_create_from_class(&lv_line_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +105,7 @@ bool lv_line_get_y_invert(const lv_obj_t * obj)
|
|||||||
|
|
||||||
static void lv_line_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_line_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("line create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_line_t * line = (lv_line_t *) obj;
|
lv_line_t * line = (lv_line_t *) obj;
|
||||||
|
|
||||||
@@ -126,7 +127,7 @@ static void lv_line_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("line created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static lv_draw_res_t lv_line_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode)
|
static lv_draw_res_t lv_line_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode)
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ const lv_obj_class_t lv_meter_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_meter_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_meter_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_meter_class, parent, copy);
|
return lv_obj_create_from_class(&lv_meter_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +210,7 @@ void lv_meter_set_indicator_end_value(lv_obj_t * obj, lv_meter_indicator_t * ind
|
|||||||
|
|
||||||
static void lv_meter_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_meter_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("line meter create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_meter_t * meter = (lv_meter_t *) obj;
|
lv_meter_t * meter = (lv_meter_t *) obj;
|
||||||
|
|
||||||
@@ -229,7 +230,7 @@ static void lv_meter_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
// meter->cur_value = copy_meter->cur_value;
|
// meter->cur_value = copy_meter->cur_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("line meter created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_meter_destructor(lv_obj_t * obj)
|
static void lv_meter_destructor(lv_obj_t * obj)
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ const lv_obj_class_t lv_roller_label_class = {
|
|||||||
*/
|
*/
|
||||||
lv_obj_t * lv_roller_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_roller_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_roller_class, parent, copy);
|
return lv_obj_create_from_class(&lv_roller_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,7 +313,7 @@ static void lv_roller_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
roller->sel_opt_id_ori = copy_roller->sel_opt_id;
|
roller->sel_opt_id_ori = copy_roller->sel_opt_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("roller created");
|
LV_LOG_TRACE("finshed");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ const lv_obj_class_t lv_slider_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_slider_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_slider_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_slider_class, parent, copy);
|
return lv_obj_create_from_class(&lv_slider_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ const lv_obj_class_t lv_switch_class = {
|
|||||||
*/
|
*/
|
||||||
lv_obj_t * lv_switch_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_switch_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_switch_class, parent, copy);
|
return lv_obj_create_from_class(&lv_switch_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ lv_obj_t * lv_switch_create(lv_obj_t * parent, const lv_obj_t * copy)
|
|||||||
|
|
||||||
static void lv_switch_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_switch_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("switch create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
if(copy == NULL) {
|
if(copy == NULL) {
|
||||||
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
|
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
|
||||||
@@ -82,7 +83,7 @@ static void lv_switch_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
lv_obj_set_size(obj, LV_DPX(60), LV_DPX(35));
|
lv_obj_set_size(obj, LV_DPX(60), LV_DPX(35));
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("switch created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static lv_draw_res_t lv_switch_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode)
|
static lv_draw_res_t lv_switch_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode)
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ const lv_obj_class_t lv_table_class = {
|
|||||||
|
|
||||||
lv_obj_t * lv_table_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_table_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_table_class, parent, copy);
|
return lv_obj_create_from_class(&lv_table_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,7 +384,7 @@ void lv_table_get_selected_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col)
|
|||||||
|
|
||||||
static void lv_table_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_table_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("lv_table create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_table_t * table = (lv_table_t *) obj;
|
lv_table_t * table = (lv_table_t *) obj;
|
||||||
|
|
||||||
@@ -413,7 +414,8 @@ static void lv_table_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
lv_table_set_row_cnt(obj, copy_table->row_cnt);
|
lv_table_set_row_cnt(obj, copy_table->row_cnt);
|
||||||
lv_table_set_col_cnt(obj, copy_table->col_cnt);
|
lv_table_set_col_cnt(obj, copy_table->col_cnt);
|
||||||
}
|
}
|
||||||
LV_LOG_INFO("table created");
|
|
||||||
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_table_destructor(lv_obj_t * obj)
|
static void lv_table_destructor(lv_obj_t * obj)
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ static const char * ta_insert_replace;
|
|||||||
*/
|
*/
|
||||||
lv_obj_t * lv_textarea_create(lv_obj_t * parent, const lv_obj_t * copy)
|
lv_obj_t * lv_textarea_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
|
LV_LOG_INFO("begin")
|
||||||
return lv_obj_create_from_class(&lv_textarea_class, parent, copy);
|
return lv_obj_create_from_class(&lv_textarea_class, parent, copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,8 +134,7 @@ void lv_textarea_add_char(lv_obj_t * obj, uint32_t c)
|
|||||||
uint32_t c_uni = _lv_txt_encoded_next((const char *)&c, NULL);
|
uint32_t c_uni = _lv_txt_encoded_next((const char *)&c, NULL);
|
||||||
|
|
||||||
if(char_is_accepted(obj, c_uni) == false) {
|
if(char_is_accepted(obj, c_uni) == false) {
|
||||||
LV_LOG_INFO("Character is no accepted by the text area (too long text or not in the "
|
LV_LOG_INFO("Character is not accepted by the text area (too long text or not in the accepted list)");
|
||||||
"accepted list)");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -946,7 +946,7 @@ void lv_textarea_cursor_up(lv_obj_t * obj)
|
|||||||
|
|
||||||
static void lv_textarea_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
static void lv_textarea_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||||
{
|
{
|
||||||
LV_LOG_TRACE("text area create started");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_textarea_t * ta = (lv_textarea_t *) obj;
|
lv_textarea_t * ta = (lv_textarea_t *) obj;
|
||||||
|
|
||||||
@@ -1005,7 +1005,7 @@ static void lv_textarea_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
|||||||
|
|
||||||
start_cursor_blink(obj);
|
start_cursor_blink(obj);
|
||||||
|
|
||||||
LV_LOG_INFO("text area created");
|
LV_LOG_TRACE("finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_textarea_destructor(lv_obj_t * obj)
|
static void lv_textarea_destructor(lv_obj_t * obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user