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 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;
lv_obj_t ** next = lv_ll_ins_tail(&group->obj_ll);
lv_mem_assert(next);

View File

@ -254,9 +254,7 @@ static void indev_proc_task(void * param)
(void)param;
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "indev_proc task started");
#endif
LV_LOG_TRACE("indev task started");
lv_indev_data_t data;
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*/
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "indev_proc task finished");
#endif
LV_LOG_TRACE("indev task finished");
}

View File

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

View File

@ -167,9 +167,8 @@ void lv_refr_pop_from_buf(uint16_t num)
static void lv_refr_task(void * param)
{
(void)param;
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "display refresh task started");
#endif
LV_LOG_TRACE("display refresh task started");
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);
}
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "display refresh task finished");
#endif
LV_LOG_TRACE("display refresh task finished");
}

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 USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: character's bitmap not found");
#endif
LV_LOG_WARN("Font: character's bitmap not found");
return;
}
lv_coord_t pos_x = pos_p->x;
lv_coord_t pos_y = pos_p->y;
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->driver.disp_flush != NULL) {
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "Disp. flush called");
#endif
LV_LOG_TRACE("disp flush started");
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 {
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Disp. flush: function not set");
#endif
LV_LOG_WARN("disp flush function registered");
}
}

View File

@ -111,17 +111,12 @@ bool lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data)
if(indev->driver.read) {
data->user_data = indev->driver.user_data;
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "Indev read called");
#endif
LV_LOG_TRACE("idnev read started");
cont = indev->driver.read(data);
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Indev read ready");
#endif
LV_LOG_TRACE("idnev read finished");
} else {
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Indev read: function not set");
#endif
LV_LOG_WARN("indev function registered");
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)
{
LV_LOG_TRACE("animation create started")
/* 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*/
@ -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`)*/
anim_list_changed = true;
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Animation created");
#endif
LV_LOG_TRACE("animation created")
}
/**

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;
}
#if USE_LV_LOG
if(letter >= ' ') lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: glyph not found");
#endif
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;
}
#if USE_LV_LOG
if(letter >= ' ') lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: character's width not found");
#endif
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;
}
#if USE_LV_LOG
if(letter >= ' ') lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: character's width not found");
#endif
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;
}
#if USE_LV_LOG
if(letter >= ' ') lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: character's bpp not found");
#endif
return 0;
}

View File

@ -27,8 +27,7 @@ extern "C" {
/*Possible log level. For compatibility declare it independently from `USE_LV_LOG`*/
typedef enum
{
LV_LOG_LEVEL_DEBUG = 0, /*A lot of logs to show every detail*/
LV_LOG_LEVEL_TRACE, /*Trace the most important calls*/
LV_LOG_LEVEL_TRACE, /*A lot of logs to give detailed information*/
LV_LOG_LEVEL_INFO, /*Log important events*/
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*/
@ -61,11 +60,19 @@ void lv_log_add(lv_log_level_t level, const char * file, uint32_t line, const ch
* 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*/
/*Do nothing if `USE_LV_LOG 0`*/
#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*/
#ifdef __cplusplus

View File

@ -159,9 +159,8 @@ void * lv_mem_alloc(uint32_t size)
}
#endif
#if USE_LV_LOG
if(alloc == NULL) lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Couldn't allocate memory");
#endif
if(alloc == NULL) LV_LOG_WARN("Couldn't allocate memory");
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_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Couldn't allocate memory");
#endif
if(new_p == NULL) LV_LOG_WARN("Couldn't allocate memory");
return new_p;
}

View File

@ -106,7 +106,7 @@ uint32_t lv_mem_get_size(const void * data);
#if USE_LV_LOG == 0
# define lv_mem_assert(p) {if(p == NULL) while(1); }
#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
#ifdef __cplusplus
} /* extern "C" */

View File

@ -56,10 +56,7 @@ void lv_task_init(void)
*/
LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "lv_task_handler started");
#endif
LV_LOG_TRACE("lv_task_handler started");
static uint32_t idle_period_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_add(LV_LOG_LEVEL_DEBUG, __FILE__, __LINE__, "lv_task_handler finished");
#endif
LV_LOG_TRACE("lv_task_handler ready");
}
/**

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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Arc create stared");
#endif
LV_LOG_TRACE("arc create started");
/*Create the ancestor of arc*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Arc create ready");
#endif
LV_LOG_INFO("arc created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Bar create stared");
#endif
LV_LOG_TRACE("lv_bar create started");
/*Create the ancestor basic object*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Bar create ready");
#endif
LV_LOG_INFO("bar created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Button create stared");
#endif
LV_LOG_TRACE("button create started");
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Button create raedy");
#endif
LV_LOG_INFO("button created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Button matrix create stared");
#endif
LV_LOG_TRACE("button matrix create started");
/*Create the ancestor object*/
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;
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");
#endif
LV_LOG_INFO("button matrix created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Calendar create stared");
#endif
LV_LOG_TRACE("calendar create started");
/*Create the ancestor of calendar*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Calendar create ready");
#endif
LV_LOG_INFO("calendar created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Check box create stared");
#endif
LV_LOG_TRACE("check box create started");
/*Create the ancestor basic object*/
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);
#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;
}

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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Chart create stared");
#endif
LV_LOG_TRACE("chart create started");
/*Create the ancestor basic object*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Chart create ready");
#endif
LV_LOG_INFO("chart created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Container create stared");
#endif
LV_LOG_TRACE("container create started");
/*Create a basic object*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Container create ready");
#endif
LV_LOG_INFO("container created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Drop down list create stared");
#endif
LV_LOG_TRACE("drop down list create started");
/*Create the ancestor drop down list*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Drop down list create ready");
#endif
LV_LOG_INFO("drop down list created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Gauge create stared");
#endif
LV_LOG_TRACE("gauge create started");
/*Create the ancestor gauge*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Gauge create ready");
#endif
LV_LOG_INFO("gauge created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Image create stared");
#endif
LV_LOG_TRACE("image create started");
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Image create ready");
#endif
LV_LOG_INFO("image created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Keyboard create stared");
#endif
LV_LOG_TRACE("keyboard create started");
/*Create the ancestor of keyboard*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Keyboard create ready");
#endif
LV_LOG_INFO("keyboard created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Label create stared");
#endif
LV_LOG_TRACE("label create started");
/*Create a basic object*/
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);
}
#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;
}

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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Led create stared");
#endif
LV_LOG_TRACE("led create started");
/*Create the ancestor basic object*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Led create ready");
#endif
LV_LOG_INFO("led created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Line create stared");
#endif
LV_LOG_TRACE("line create started");
/*Create a basic object*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Line create ready");
#endif
LV_LOG_INFO("line created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "List create stared");
#endif
LV_LOG_TRACE("list create started");
/*Create the ancestor basic object*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "List create ready");
#endif
LV_LOG_INFO("list created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Line meter create stared");
#endif
LV_LOG_TRACE("line meter create started");
/*Create the ancestor of line meter*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Line meter create ready");
#endif
LV_LOG_INFO("line meter created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Message box create stared");
#endif
LV_LOG_TRACE("mesasge box create started");
/*Create the ancestor message box*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Message box create ready");
#endif
LV_LOG_INFO("mesasge box created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "template create stared");
#endif
LV_LOG_TRACE("template create started");
/*Create the ancestor of template*/
/*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*/
lv_obj_refresh_style(new_templ);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "template create ready");
#endif
LV_LOG_INFO("template created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Page create stared");
#endif
LV_LOG_TRACE("page create started");
/*Create the ancestor object*/
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);
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Page create ready");
#endif
LV_LOG_INFO("page created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Preloader create stared");
#endif
LV_LOG_TRACE("preload create started");
/*Create the ancestor of pre loader*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Preloader create ready");
#endif
LV_LOG_INFO("preload created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Roller create stared");
#endif
LV_LOG_TRACE("roller create started");
/*Create the ancestor of roller*/
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*/
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Roller create ready");
#endif
LV_LOG_INFO("roller created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Slider create stared");
#endif
LV_LOG_TRACE("slider create started");
/*Create the ancestor slider*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Slider create ready");
#endif
LV_LOG_INFO("slider created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Switch create stared");
#endif
LV_LOG_TRACE("switch create started");
/*Create the ancestor of switch*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Switch create ready");
#endif
LV_LOG_INFO("switch created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Text area create stared");
#endif
LV_LOG_TRACE("text area create started");
/*Create the ancestor object*/
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);
#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;
}
@ -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);
if(ext->one_line && (c == '\n' || c == '\n')) {
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Text area: line break ignored in one-line mode");
#endif
LV_LOG_INFO("Text area: line break ignored in one-line mode");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Tabview create stared");
#endif
LV_LOG_TRACE("tab view create started");
/*Create the ancestor of tab*/
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);
}
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Tabview create ready");
#endif
LV_LOG_INFO("tab view created");
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)
{
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Window create stared");
#endif
LV_LOG_TRACE("window create started");
/*Create the ancestor object*/
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);
#if USE_LV_LOG
lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Window create ready");
#endif
LV_LOG_INFO("window created");
return new_win;
}

1
lvgl.h
View File

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