1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

improve logging

This commit is contained in:
Gabor Kiss-Vamosi 2018-07-25 20:39:24 +02:00
parent 2d5fa3b9dc
commit 678cbdc23d
41 changed files with 128 additions and 283 deletions

View File

@ -90,6 +90,15 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
{ {
if(group == NULL) return; if(group == NULL) return;
/*If the object is already in a group and focused then defocuse it*/
if(obj->group_p) {
if(lv_obj_is_focused(obj)) {
lv_group_focus_next(obj->group_p);
LV_LOG_INFO("group: assign object to an other group");
}
}
obj->group_p = group; obj->group_p = group;
lv_obj_t ** next = lv_ll_ins_tail(&group->obj_ll); lv_obj_t ** next = lv_ll_ins_tail(&group->obj_ll);
lv_mem_assert(next); lv_mem_assert(next);

View File

@ -254,9 +254,7 @@ static void indev_proc_task(void * param)
(void)param; (void)param;
#if USE_LV_LOG LV_LOG_TRACE("indev task started");
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "indev_proc task started");
#endif
lv_indev_data_t data; lv_indev_data_t data;
lv_indev_t * i; lv_indev_t * i;
@ -297,9 +295,7 @@ static void indev_proc_task(void * param)
indev_act = NULL; /*End of indev processing, so no act indev*/ indev_act = NULL; /*End of indev processing, so no act indev*/
#if USE_LV_LOG LV_LOG_TRACE("indev task finished");
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "indev_proc task finished");
#endif
} }

View File

@ -62,9 +62,7 @@ static lv_ll_t scr_ll; /*Linked list of screens*/
*/ */
void lv_init(void) void lv_init(void)
{ {
#if USE_LV_LOG LV_LOG_TRACE("lv_init started");
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "lv_init called");
#endif
/*Initialize the lv_misc modules*/ /*Initialize the lv_misc modules*/
lv_mem_init(); lv_mem_init();
@ -106,9 +104,8 @@ void lv_init(void)
lv_indev_init(); lv_indev_init();
#endif #endif
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "lv_init ready"); LV_LOG_INFO("lv_init ready");
#endif
} }
/*-------------------- /*--------------------
@ -128,9 +125,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
lv_obj_t * new_obj = NULL; lv_obj_t * new_obj = NULL;
/*Create a screen if the parent is NULL*/ /*Create a screen if the parent is NULL*/
if(parent == NULL) { if(parent == NULL) {
#if USE_LV_LOG LV_LOG_TRACE("Screen create started");
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Screen create started");
#endif
new_obj = lv_ll_ins_head(&scr_ll); new_obj = lv_ll_ins_head(&scr_ll);
lv_mem_assert(new_obj); lv_mem_assert(new_obj);
@ -182,15 +177,12 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->ext_attr = NULL; new_obj->ext_attr = NULL;
#if USE_LV_LOG LV_LOG_INFO("Screen create ready");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Screen create ready");
#endif
} }
/*parent != NULL create normal obj. on a parent*/ /*parent != NULL create normal obj. on a parent*/
else { else {
#if USE_LV_LOG LV_LOG_TRACE("Object create started");
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Object create started");
#endif
new_obj = lv_ll_ins_head(&(parent)->child_ll); new_obj = lv_ll_ins_head(&(parent)->child_ll);
lv_mem_assert(new_obj); lv_mem_assert(new_obj);
if(new_obj == NULL) return NULL; if(new_obj == NULL) return NULL;
@ -273,9 +265,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
lv_obj_set_pos(new_obj, lv_obj_get_x(copy), lv_obj_get_y(copy)); lv_obj_set_pos(new_obj, lv_obj_get_x(copy), lv_obj_get_y(copy));
#if USE_LV_LOG LV_LOG_INFO("Object create ready");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Object create ready");
#endif
} }

View File

@ -167,9 +167,8 @@ void lv_refr_pop_from_buf(uint16_t num)
static void lv_refr_task(void * param) static void lv_refr_task(void * param)
{ {
(void)param; (void)param;
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "display refresh task started"); LV_LOG_TRACE("display refresh task started");
#endif
uint32_t start = lv_tick_get(); uint32_t start = lv_tick_get();
@ -189,9 +188,8 @@ static void lv_refr_task(void * param)
monitor_cb(lv_tick_elaps(start), px_num); monitor_cb(lv_tick_elaps(start), px_num);
} }
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "display refresh task finished"); LV_LOG_TRACE("display refresh task finished");
#endif
} }

View File

@ -217,13 +217,10 @@ void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
}; };
if(font_p == NULL) { if(font_p == NULL) {
#if USE_LV_LOG LV_LOG_WARN("Font: character's bitmap not found");
lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: character's bitmap not found");
#endif
return; return;
} }
lv_coord_t pos_x = pos_p->x; lv_coord_t pos_x = pos_p->x;
lv_coord_t pos_y = pos_p->y; lv_coord_t pos_y = pos_p->y;
uint8_t letter_w = lv_font_get_real_width(font_p, letter); uint8_t letter_w = lv_font_get_real_width(font_p, letter);

View File

@ -150,19 +150,12 @@ void lv_disp_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t *
if(active == NULL) return; if(active == NULL) return;
if(active->driver.disp_flush != NULL) { if(active->driver.disp_flush != NULL) {
#if USE_LV_LOG LV_LOG_TRACE("disp flush started");
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "Disp. flush called");
#endif
active->driver.disp_flush(x1, y1, x2, y2, color_p); active->driver.disp_flush(x1, y1, x2, y2, color_p);
LV_LOG_TRACE("disp flush ready");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Disp. flush ready");
#endif
} else { } else {
LV_LOG_WARN("disp flush function registered");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Disp. flush: function not set");
#endif
} }
} }

View File

@ -111,17 +111,12 @@ bool lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data)
if(indev->driver.read) { if(indev->driver.read) {
data->user_data = indev->driver.user_data; data->user_data = indev->driver.user_data;
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "Indev read called"); LV_LOG_TRACE("idnev read started");
#endif
cont = indev->driver.read(data); cont = indev->driver.read(data);
#if USE_LV_LOG LV_LOG_TRACE("idnev read finished");
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Indev read ready");
#endif
} else { } else {
#if USE_LV_LOG LV_LOG_WARN("indev function registered");
lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Indev read: function not set");
#endif
memset(data, 0, sizeof(lv_indev_data_t)); memset(data, 0, sizeof(lv_indev_data_t));
} }

View File

@ -62,7 +62,7 @@ void lv_anim_init(void)
*/ */
void lv_anim_create(lv_anim_t * anim_p) void lv_anim_create(lv_anim_t * anim_p)
{ {
LV_LOG_TRACE("animation create started")
/* 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(anim_p->fp != NULL) lv_anim_del(anim_p->var, anim_p->fp); /*fp == NULL would delete all animations of var*/ if(anim_p->fp != NULL) lv_anim_del(anim_p->var, anim_p->fp); /*fp == NULL would delete all animations of var*/
@ -82,10 +82,7 @@ void lv_anim_create(lv_anim_t * anim_p)
* 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_list_changed = true; anim_list_changed = true;
LV_LOG_TRACE("animation created")
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Animation created");
#endif
} }
/** /**

View File

@ -104,9 +104,6 @@ const uint8_t * lv_font_get_bitmap(const lv_font_t * font_p, uint32_t letter)
font_i = font_i->next_page; font_i = font_i->next_page;
} }
#if USE_LV_LOG
if(letter >= ' ') lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: glyph not found");
#endif
return NULL; return NULL;
} }
@ -132,9 +129,6 @@ uint8_t lv_font_get_width(const lv_font_t * font_p, uint32_t letter)
font_i = font_i->next_page; font_i = font_i->next_page;
} }
#if USE_LV_LOG
if(letter >= ' ') lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: character's width not found");
#endif
return 0; return 0;
} }
@ -156,9 +150,6 @@ uint8_t lv_font_get_real_width(const lv_font_t * font_p, uint32_t letter)
font_i = font_i->next_page; font_i = font_i->next_page;
} }
#if USE_LV_LOG
if(letter >= ' ') lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: character's width not found");
#endif
return 0; return 0;
} }
@ -178,9 +169,6 @@ uint8_t lv_font_get_bpp(const lv_font_t * font, uint32_t letter)
font_i = font_i->next_page; font_i = font_i->next_page;
} }
#if USE_LV_LOG
if(letter >= ' ') lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: character's bpp not found");
#endif
return 0; return 0;
} }

View File

@ -27,8 +27,7 @@ extern "C" {
/*Possible log level. For compatibility declare it independently from `USE_LV_LOG`*/ /*Possible log level. For compatibility declare it independently from `USE_LV_LOG`*/
typedef enum typedef enum
{ {
LV_LOG_LEVEL_DEBUG = 0, /*A lot of logs to show every detail*/ LV_LOG_LEVEL_TRACE, /*A lot of logs to give detailed information*/
LV_LOG_LEVEL_TRACE, /*Trace the most important calls*/
LV_LOG_LEVEL_INFO, /*Log important events*/ LV_LOG_LEVEL_INFO, /*Log important events*/
LV_LOG_LEVEL_WARN, /*Log if something unwanted happened but didn't caused problem*/ LV_LOG_LEVEL_WARN, /*Log if something unwanted happened but didn't caused problem*/
LV_LOG_LEVEL_ERROR, /*Only critical issue, when the system may fail*/ LV_LOG_LEVEL_ERROR, /*Only critical issue, when the system may fail*/
@ -61,11 +60,19 @@ void lv_log_add(lv_log_level_t level, const char * file, uint32_t line, const ch
* MACROS * MACROS
**********************/ **********************/
#define LV_LOG_TRACE(dsc) lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, dsc);
#define LV_LOG_INFO(dsc) lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, dsc);
#define LV_LOG_WARN(dsc) lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, dsc);
#define LV_LOG_ERROR(dsc) lv_log_add(LV_LOG_LEVEL_ERROR, __FILE__, __LINE__, dsc);
#else /*USE_LV_LOG*/ #else /*USE_LV_LOG*/
/*Do nothing if `USE_LV_LOG 0`*/ /*Do nothing if `USE_LV_LOG 0`*/
#define lv_log_add(level, file, line, dsc) {;} #define lv_log_add(level, file, line, dsc) {;}
#define LV_LOG_TRACE(dsc) {;}
#define LV_LOG_INFO(dsc) {;}
#define LV_LOG_WARN(dsc) {;}
#define LV_LOG_ERROR(dsc) {;}
#endif /*USE_LV_LOG*/ #endif /*USE_LV_LOG*/
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -159,9 +159,8 @@ void * lv_mem_alloc(uint32_t size)
} }
#endif #endif
#if USE_LV_LOG if(alloc == NULL) LV_LOG_WARN("Couldn't allocate memory");
if(alloc == NULL) lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Couldn't allocate memory");
#endif
return alloc; return alloc;
} }
@ -245,9 +244,8 @@ void * lv_mem_realloc(void * data_p, uint32_t new_size)
} }
#if USE_LV_LOG if(new_p == NULL) LV_LOG_WARN("Couldn't allocate memory");
if(new_p == NULL) lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Couldn't allocate memory");
#endif
return new_p; return new_p;
} }

View File

@ -106,7 +106,7 @@ uint32_t lv_mem_get_size(const void * data);
#if USE_LV_LOG == 0 #if USE_LV_LOG == 0
# define lv_mem_assert(p) {if(p == NULL) while(1); } # define lv_mem_assert(p) {if(p == NULL) while(1); }
#else #else
# define lv_mem_assert(p) {if(p == NULL) {lv_log_add(LV_LOG_LEVEL_ERROR, __FILE__, __LINE__, "Out of memory!"); while(1); }} # define lv_mem_assert(p) {if(p == NULL) {LV_LOG_ERROR("Out of memory!"); while(1); }}
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View File

@ -56,10 +56,7 @@ void lv_task_init(void)
*/ */
LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void) LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
{ {
LV_LOG_TRACE("lv_task_handler started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "lv_task_handler started");
#endif
static uint32_t idle_period_start = 0; static uint32_t idle_period_start = 0;
static uint32_t handler_start = 0; static uint32_t handler_start = 0;
@ -134,9 +131,7 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
} }
#if USE_LV_LOG LV_LOG_TRACE("lv_task_handler ready");
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "lv_task_handler finished");
#endif
} }
/** /**

View File

@ -51,9 +51,7 @@ static lv_design_func_t ancestor_design;
lv_obj_t * lv_arc_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_arc_create(lv_obj_t * par, lv_obj_t * copy)
{ {
#if USE_LV_LOG LV_LOG_TRACE("arc create started");
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Arc create stared");
#endif
/*Create the ancestor of arc*/ /*Create the ancestor of arc*/
lv_obj_t * new_arc = lv_obj_create(par, copy); lv_obj_t * new_arc = lv_obj_create(par, copy);
@ -90,9 +88,7 @@ lv_obj_t * lv_arc_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_arc); lv_obj_refresh_style(new_arc);
} }
#if USE_LV_LOG LV_LOG_INFO("arc created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Arc create ready");
#endif
return new_arc; return new_arc;
} }

View File

@ -52,10 +52,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_bar_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_bar_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("lv_bar create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Bar create stared");
#endif
/*Create the ancestor basic object*/ /*Create the ancestor basic object*/
lv_obj_t * new_bar = lv_obj_create(par, copy); lv_obj_t * new_bar = lv_obj_create(par, copy);
@ -103,9 +100,7 @@ lv_obj_t * lv_bar_create(lv_obj_t * par, lv_obj_t * copy)
lv_bar_set_value(new_bar, ext->cur_value); lv_bar_set_value(new_bar, ext->cur_value);
} }
#if USE_LV_LOG LV_LOG_INFO("bar created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Bar create ready");
#endif
return new_bar; return new_bar;
} }

View File

@ -67,10 +67,7 @@ static lv_point_t ink_point;
*/ */
lv_obj_t * lv_btn_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_btn_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("button create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Button create stared");
#endif
lv_obj_t * new_btn; lv_obj_t * new_btn;
@ -140,10 +137,7 @@ lv_obj_t * lv_btn_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_btn); lv_obj_refresh_style(new_btn);
} }
LV_LOG_INFO("button created");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Button create raedy");
#endif
return new_btn; return new_btn;
} }

View File

@ -64,10 +64,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_btnm_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_btnm_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("button matrix create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Button matrix create stared");
#endif
/*Create the ancestor object*/ /*Create the ancestor object*/
lv_obj_t * new_btnm = lv_obj_create(par, copy); lv_obj_t * new_btnm = lv_obj_create(par, copy);
@ -126,9 +123,8 @@ lv_obj_t * lv_btnm_create(lv_obj_t * par, lv_obj_t * copy)
ext->btn_id_tgl = copy_ext->btn_id_tgl; ext->btn_id_tgl = copy_ext->btn_id_tgl;
lv_btnm_set_map(new_btnm, lv_btnm_get_map(copy)); lv_btnm_set_map(new_btnm, lv_btnm_get_map(copy));
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Button matrix create ready"); LV_LOG_INFO("button matrix created");
#endif
return new_btnm; return new_btnm;
} }

View File

@ -70,10 +70,7 @@ static const char * month_name[12] = {"January", "February", "March", "Ap
*/ */
lv_obj_t * lv_calendar_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_calendar_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("calendar create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Calendar create stared");
#endif
/*Create the ancestor of calendar*/ /*Create the ancestor of calendar*/
lv_obj_t * new_calendar = lv_obj_create(par, copy); lv_obj_t * new_calendar = lv_obj_create(par, copy);
@ -144,10 +141,7 @@ lv_obj_t * lv_calendar_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_calendar); lv_obj_refresh_style(new_calendar);
} }
#if USE_LV_LOG LV_LOG_INFO("calendar created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Calendar create ready");
#endif
return new_calendar; return new_calendar;
} }

View File

@ -51,9 +51,7 @@ static lv_signal_func_t ancestor_signal;
lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy)
{ {
#if USE_LV_LOG LV_LOG_TRACE("check box create started");
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Check box create stared");
#endif
/*Create the ancestor basic object*/ /*Create the ancestor basic object*/
lv_obj_t * new_cb = lv_btn_create(par, copy); lv_obj_t * new_cb = lv_btn_create(par, copy);
@ -110,10 +108,8 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_set_design_func(ext->bullet, lv_bullet_design); lv_obj_set_design_func(ext->bullet, lv_bullet_design);
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Check box create ready");
#endif
LV_LOG_INFO("check box created");
return new_cb; return new_cb;
} }

View File

@ -58,9 +58,8 @@ static lv_signal_func_t ancestor_signal;
lv_obj_t * lv_chart_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_chart_create(lv_obj_t * par, lv_obj_t * copy)
{ {
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Chart create stared"); LV_LOG_TRACE("chart create started");
#endif
/*Create the ancestor basic object*/ /*Create the ancestor basic object*/
lv_obj_t * new_chart = lv_obj_create(par, copy); lv_obj_t * new_chart = lv_obj_create(par, copy);
@ -116,9 +115,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_chart); lv_obj_refresh_style(new_chart);
} }
#if USE_LV_LOG LV_LOG_INFO("chart created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Chart create ready");
#endif
return new_chart; return new_chart;

View File

@ -63,9 +63,8 @@ static lv_signal_func_t ancestor_signal;
lv_obj_t * lv_cont_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_cont_create(lv_obj_t * par, lv_obj_t * copy)
{ {
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Container create stared"); LV_LOG_TRACE("container create started");
#endif
/*Create a basic object*/ /*Create a basic object*/
lv_obj_t * new_cont = lv_obj_create(par, copy); lv_obj_t * new_cont = lv_obj_create(par, copy);
@ -106,11 +105,10 @@ lv_obj_t * lv_cont_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_cont); lv_obj_refresh_style(new_cont);
} }
#if USE_LV_LOG LV_LOG_INFO("container created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Container create ready");
#endif
return new_cont;
return new_cont;
} }
/*===================== /*=====================

View File

@ -66,10 +66,7 @@ static lv_design_func_t ancestor_design;
*/ */
lv_obj_t * lv_ddlist_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_ddlist_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("drop down list create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Drop down list create stared");
#endif
/*Create the ancestor drop down list*/ /*Create the ancestor drop down list*/
lv_obj_t * new_ddlist = lv_page_create(par, copy); lv_obj_t * new_ddlist = lv_page_create(par, copy);
@ -143,9 +140,8 @@ lv_obj_t * lv_ddlist_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_ddlist); lv_obj_refresh_style(new_ddlist);
} }
#if USE_LV_LOG LV_LOG_INFO("drop down list created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Drop down list create ready");
#endif
return new_ddlist; return new_ddlist;
} }

View File

@ -60,10 +60,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_gauge_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_gauge_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("gauge create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Gauge create stared");
#endif
/*Create the ancestor gauge*/ /*Create the ancestor gauge*/
lv_obj_t * new_gauge = lv_lmeter_create(par, copy); lv_obj_t * new_gauge = lv_lmeter_create(par, copy);
@ -116,9 +113,7 @@ lv_obj_t * lv_gauge_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_gauge); lv_obj_refresh_style(new_gauge);
} }
#if USE_LV_LOG LV_LOG_INFO("gauge created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Gauge create ready");
#endif
return new_gauge; return new_gauge;
} }

View File

@ -54,10 +54,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_img_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_img_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("image create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Image create stared");
#endif
lv_obj_t * new_img = NULL; lv_obj_t * new_img = NULL;
@ -102,9 +99,8 @@ lv_obj_t * lv_img_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_img); lv_obj_refresh_style(new_img);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Image create ready"); LV_LOG_INFO("image created");
#endif
return new_img; return new_img;
} }

View File

@ -75,10 +75,7 @@ static const char * kb_map_num[] = {
*/ */
lv_obj_t * lv_kb_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_kb_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("keyboard create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Keyboard create stared");
#endif
/*Create the ancestor of keyboard*/ /*Create the ancestor of keyboard*/
lv_obj_t * new_kb = lv_btnm_create(par, copy); lv_obj_t * new_kb = lv_btnm_create(par, copy);
@ -137,9 +134,9 @@ lv_obj_t * lv_kb_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_kb); lv_obj_refresh_style(new_kb);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Keyboard create ready"); LV_LOG_INFO("keyboard created");
#endif
return new_kb; return new_kb;
} }

View File

@ -64,10 +64,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_label_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_label_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("label create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Label create stared");
#endif
/*Create a basic object*/ /*Create a basic object*/
lv_obj_t * new_label = lv_obj_create(par, copy); lv_obj_t * new_label = lv_obj_create(par, copy);
@ -128,10 +125,8 @@ lv_obj_t * lv_label_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_label); lv_obj_refresh_style(new_label);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Label create ready");
#endif
LV_LOG_INFO("label created");
return new_label; return new_label;
} }

View File

@ -52,10 +52,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_led_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_led_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("led create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Led create stared");
#endif
/*Create the ancestor basic object*/ /*Create the ancestor basic object*/
lv_obj_t * new_led = lv_obj_create(par, copy); lv_obj_t * new_led = lv_obj_create(par, copy);
@ -96,9 +93,8 @@ lv_obj_t * lv_led_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_led); lv_obj_refresh_style(new_led);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Led create ready"); LV_LOG_INFO("led created");
#endif
return new_led; return new_led;
} }

View File

@ -50,10 +50,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_line_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_line_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("line create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Line create stared");
#endif
/*Create a basic object*/ /*Create a basic object*/
lv_obj_t * new_line = lv_obj_create(par, copy); lv_obj_t * new_line = lv_obj_create(par, copy);
@ -92,9 +89,8 @@ lv_obj_t * lv_line_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_line); lv_obj_refresh_style(new_line);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Line create ready"); LV_LOG_INFO("line created");
#endif
return new_line; return new_line;
} }

View File

@ -71,10 +71,7 @@ static lv_obj_t * last_clicked_btn;
*/ */
lv_obj_t * lv_list_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_list_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("list create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "List create stared");
#endif
/*Create the ancestor basic object*/ /*Create the ancestor basic object*/
lv_obj_t * new_list = lv_page_create(par, copy); lv_obj_t * new_list = lv_page_create(par, copy);
@ -143,9 +140,9 @@ lv_obj_t * lv_list_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_list); lv_obj_refresh_style(new_list);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "List create ready"); LV_LOG_INFO("list created");
#endif
return new_list; return new_list;
} }

View File

@ -52,10 +52,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_lmeter_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_lmeter_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("line meter create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Line meter create stared");
#endif
/*Create the ancestor of line meter*/ /*Create the ancestor of line meter*/
lv_obj_t * new_lmeter = lv_obj_create(par, copy); lv_obj_t * new_lmeter = lv_obj_create(par, copy);
@ -105,9 +102,7 @@ lv_obj_t * lv_lmeter_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_lmeter); lv_obj_refresh_style(new_lmeter);
} }
#if USE_LV_LOG LV_LOG_INFO("line meter created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Line meter create ready");
#endif
return new_lmeter; return new_lmeter;
} }

View File

@ -60,10 +60,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_mbox_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_mbox_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("mesasge box create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Message box create stared");
#endif
/*Create the ancestor message box*/ /*Create the ancestor message box*/
lv_obj_t * new_mbox = lv_cont_create(par, copy); lv_obj_t * new_mbox = lv_cont_create(par, copy);
@ -118,9 +115,8 @@ lv_obj_t * lv_mbox_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_mbox); lv_obj_refresh_style(new_mbox);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Message box create ready"); LV_LOG_INFO("mesasge box created");
#endif
return new_mbox; return new_mbox;
} }

View File

@ -53,10 +53,7 @@ static lv_design_func_t ancestor_design;
*/ */
lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("template create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "template create stared");
#endif
/*Create the ancestor of template*/ /*Create the ancestor of template*/
/*TODO modify it to the ancestor create function */ /*TODO modify it to the ancestor create function */
@ -87,9 +84,9 @@ lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy)
/*Refresh the style with new signal function*/ /*Refresh the style with new signal function*/
lv_obj_refresh_style(new_templ); lv_obj_refresh_style(new_templ);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "template create ready"); LV_LOG_INFO("template created");
#endif
return new_templ; return new_templ;
} }

View File

@ -57,10 +57,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_page_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_page_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("page create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Page create stared");
#endif
/*Create the ancestor object*/ /*Create the ancestor object*/
lv_obj_t * new_page = lv_cont_create(par, copy); lv_obj_t * new_page = lv_cont_create(par, copy);
@ -145,10 +142,7 @@ lv_obj_t * lv_page_create(lv_obj_t * par, lv_obj_t * copy)
lv_page_sb_refresh(new_page); lv_page_sb_refresh(new_page);
#if USE_LV_LOG LV_LOG_INFO("page created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Page create ready");
#endif
return new_page; return new_page;
} }

View File

@ -55,10 +55,7 @@ static lv_design_func_t ancestor_design;
*/ */
lv_obj_t * lv_preload_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_preload_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("preload create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Preloader create stared");
#endif
/*Create the ancestor of pre loader*/ /*Create the ancestor of pre loader*/
lv_obj_t * new_preload = lv_arc_create(par, copy); lv_obj_t * new_preload = lv_arc_create(par, copy);
@ -109,9 +106,8 @@ lv_obj_t * lv_preload_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_preload); lv_obj_refresh_style(new_preload);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Preloader create ready"); LV_LOG_INFO("preload created");
#endif
return new_preload; return new_preload;
} }

View File

@ -60,10 +60,7 @@ static lv_signal_func_t ancestor_scrl_signal;
*/ */
lv_obj_t * lv_roller_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_roller_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("roller create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Roller create stared");
#endif
/*Create the ancestor of roller*/ /*Create the ancestor of roller*/
lv_obj_t * new_roller = lv_ddlist_create(par, copy); lv_obj_t * new_roller = lv_ddlist_create(par, copy);
@ -114,9 +111,9 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_roller); /*Refresh the style with new signal function*/ lv_obj_refresh_style(new_roller); /*Refresh the style with new signal function*/
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Roller create ready"); LV_LOG_INFO("roller created");
#endif
return new_roller; return new_roller;
} }

View File

@ -53,10 +53,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_slider_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_slider_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("slider create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Slider create stared");
#endif
/*Create the ancestor slider*/ /*Create the ancestor slider*/
lv_obj_t * new_slider = lv_bar_create(par, copy); lv_obj_t * new_slider = lv_bar_create(par, copy);
@ -106,9 +103,9 @@ lv_obj_t * lv_slider_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_slider); lv_obj_refresh_style(new_slider);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Slider create ready"); LV_LOG_INFO("slider created");
#endif
return new_slider; return new_slider;
} }

View File

@ -50,10 +50,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_sw_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_sw_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("switch create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Switch create stared");
#endif
/*Create the ancestor of switch*/ /*Create the ancestor of switch*/
lv_obj_t * new_sw = lv_slider_create(par, copy); lv_obj_t * new_sw = lv_slider_create(par, copy);
@ -105,9 +102,7 @@ lv_obj_t * lv_sw_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_sw); lv_obj_refresh_style(new_sw);
} }
#if USE_LV_LOG LV_LOG_INFO("switch created");
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Switch create ready");
#endif
return new_sw; return new_sw;
} }

View File

@ -74,10 +74,7 @@ static lv_signal_func_t scrl_signal;
*/ */
lv_obj_t * lv_ta_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_ta_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("text area create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Text area create stared");
#endif
/*Create the ancestor object*/ /*Create the ancestor object*/
lv_obj_t * new_ta = lv_page_create(par, copy); lv_obj_t * new_ta = lv_page_create(par, copy);
@ -167,10 +164,8 @@ lv_obj_t * lv_ta_create(lv_obj_t * par, lv_obj_t * copy)
lv_anim_create(&a); lv_anim_create(&a);
#endif #endif
LV_LOG_INFO("text area created");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Text area create ready");
#endif
return new_ta; return new_ta;
} }
@ -188,9 +183,7 @@ void lv_ta_add_char(lv_obj_t * ta, char c)
lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta); lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);
if(ext->one_line && (c == '\n' || c == '\n')) { if(ext->one_line && (c == '\n' || c == '\n')) {
#if USE_LV_LOG LV_LOG_INFO("Text area: line break ignored in one-line mode");
lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Text area: line break ignored in one-line mode");
#endif
return; return;
} }

View File

@ -66,11 +66,7 @@ static const char * tab_def[] = {""};
*/ */
lv_obj_t * lv_tabview_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_tabview_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("tab view create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Tabview create stared");
#endif
/*Create the ancestor of tab*/ /*Create the ancestor of tab*/
lv_obj_t * new_tabview = lv_obj_create(par, copy); lv_obj_t * new_tabview = lv_obj_create(par, copy);
@ -176,9 +172,8 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_tabview); lv_obj_refresh_style(new_tabview);
} }
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Tabview create ready"); LV_LOG_INFO("tab view created");
#endif
return new_tabview; return new_tabview;
} }

View File

@ -46,11 +46,7 @@ static lv_signal_func_t ancestor_signal;
*/ */
lv_obj_t * lv_win_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_win_create(lv_obj_t * par, lv_obj_t * copy)
{ {
LV_LOG_TRACE("window create started");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Window create stared");
#endif
/*Create the ancestor object*/ /*Create the ancestor object*/
lv_obj_t * new_win = lv_obj_create(par, copy); lv_obj_t * new_win = lv_obj_create(par, copy);
@ -140,11 +136,7 @@ lv_obj_t * lv_win_create(lv_obj_t * par, lv_obj_t * copy)
lv_win_realign(new_win); lv_win_realign(new_win);
LV_LOG_INFO("window created");
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Window create ready");
#endif
return new_win; return new_win;
} }

1
lvgl.h
View File

@ -15,6 +15,7 @@ extern "C" {
*********************/ *********************/
/*Test misc. module version*/ /*Test misc. module version*/
#include "lv_misc/lv_log.h"
#include "lv_misc/lv_task.h" #include "lv_misc/lv_task.h"
#include "lv_hal/lv_hal.h" #include "lv_hal/lv_hal.h"