diff --git a/lv_core/lv_indev.c b/lv_core/lv_indev.c index 383f8b4b7..3d7b97690 100644 --- a/lv_core/lv_indev.c +++ b/lv_core/lv_indev.c @@ -253,6 +253,11 @@ 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_indev_data_t data; lv_indev_t * i; i = lv_indev_next(NULL); @@ -291,6 +296,10 @@ 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 } diff --git a/lv_core/lv_refr.c b/lv_core/lv_refr.c index f23b70a8b..6ad8972c6 100644 --- a/lv_core/lv_refr.c +++ b/lv_core/lv_refr.c @@ -167,6 +167,9 @@ 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 uint32_t start = lv_tick_get(); @@ -186,6 +189,9 @@ 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 } diff --git a/lv_draw/lv_draw_vbasic.c b/lv_draw/lv_draw_vbasic.c index a7187188e..ba75d4840 100644 --- a/lv_draw/lv_draw_vbasic.c +++ b/lv_draw/lv_draw_vbasic.c @@ -13,6 +13,7 @@ #include "../lv_misc/lv_area.h" #include "../lv_misc/lv_font.h" #include "../lv_misc/lv_color.h" +#include "../lv_misc/lv_log.h" #if LV_VDB_SIZE != 0 @@ -215,7 +216,12 @@ void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p, 204, 221, 238, 255 }; - if(font_p == NULL) return; + if(font_p == NULL) { +#if USE_LV_LOG + lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Font: character's bitmap not found"); +#endif + return; + } lv_coord_t pos_x = pos_p->x; diff --git a/lv_hal/lv_hal_disp.c b/lv_hal/lv_hal_disp.c index 8c8e699a2..875b0d6b3 100644 --- a/lv_hal/lv_hal_disp.c +++ b/lv_hal/lv_hal_disp.c @@ -148,7 +148,22 @@ void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t col void lv_disp_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t * color_p) { if(active == NULL) return; - if(active->driver.disp_flush != NULL) active->driver.disp_flush(x1, y1, x2, y2, color_p); + if(active->driver.disp_flush != NULL) { + +#if USE_LV_LOG + lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Disp. flush called"); +#endif + active->driver.disp_flush(x1, y1, x2, y2, color_p); + +#if USE_LV_LOG + lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Disp. flush finished"); +#endif + } else { + +#if USE_LV_LOG + lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Disp. flush: function not set"); +#endif + } } /** diff --git a/lv_hal/lv_hal_indev.c b/lv_hal/lv_hal_indev.c index d118a2272..c4dbdc949 100644 --- a/lv_hal/lv_hal_indev.c +++ b/lv_hal/lv_hal_indev.c @@ -111,8 +111,17 @@ 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_TRACE, __FILE__, __LINE__, "Indev read called"); +#endif cont = indev->driver.read(data); +#if USE_LV_LOG + lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, "Indev read finished"); +#endif } else { +#if USE_LV_LOG + lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, "Indev read: function not set"); +#endif memset(data, 0, sizeof(lv_indev_data_t)); } diff --git a/lv_misc/lv_anim.c b/lv_misc/lv_anim.c index 9b271289f..01cf7d9b3 100644 --- a/lv_misc/lv_anim.c +++ b/lv_misc/lv_anim.c @@ -62,6 +62,7 @@ void lv_anim_init(void) */ void lv_anim_create(lv_anim_t * anim_p) { + /* 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*/ @@ -80,6 +81,11 @@ void lv_anim_create(lv_anim_t * anim_p) /* Creating an animation changed the linked list. * 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 } /** diff --git a/lv_misc/lv_font.c b/lv_misc/lv_font.c index 1e5c19cd3..3a55f96ec 100644 --- a/lv_misc/lv_font.c +++ b/lv_misc/lv_font.c @@ -8,6 +8,7 @@ *********************/ #include #include "lv_font.h" +#include "lv_log.h" /********************* * DEFINES @@ -103,6 +104,9 @@ 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; } @@ -128,7 +132,11 @@ 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; + } /** @@ -148,6 +156,9 @@ 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; } @@ -167,6 +178,9 @@ 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; } diff --git a/lv_misc/lv_log.c b/lv_misc/lv_log.c index b920cb57c..014cc0470 100644 --- a/lv_misc/lv_log.c +++ b/lv_misc/lv_log.c @@ -58,15 +58,11 @@ void lv_log_add(lv_log_level_t level, const char * file, uint32_t line, const ch { if(level >= _LV_LOG_LEVEL_NUM) return; /*Invalid level*/ - if((level == LV_LOG_LEVEL_INFO && LV_LOG_INFO) || - (level == LV_LOG_LEVEL_WARN && LV_LOG_WARN) || - (level == LV_LOG_LEVEL_ERROR && LV_LOG_ERROR) || - (level == LV_LOG_LEVEL_USER && LV_LOG_USER)) - { + if(level >= LV_LOG_LEVEL) { #if LV_LOG_PRINTF - static const char * lvl_prefix[] = {"Info", "Warn", "Error", "User"}; - printf("%s %s:%d: %s\n", lvl_prefix[level], file, line, dsc); + static const char * lvl_prefix[] = {"Debug", "Trace", "Info", "Warn", "Error"}; + printf("%s: %s \t(%s #%d)\n", lvl_prefix[level], dsc, file, line); #else if(print_cb) print_cb(level, file, line, dsc); #endif diff --git a/lv_misc/lv_log.h b/lv_misc/lv_log.h index 228ca6fac..08b25fe33 100644 --- a/lv_misc/lv_log.h +++ b/lv_misc/lv_log.h @@ -27,10 +27,11 @@ extern "C" { /*Possible log level. For compatibility declare it independently from `USE_LV_LOG`*/ typedef enum { - LV_LOG_LEVEL_INFO = 0, - LV_LOG_LEVEL_WARN, - LV_LOG_LEVEL_ERROR, - LV_LOG_LEVEL_USER, + 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_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*/ _LV_LOG_LEVEL_NUM }lv_log_level_t; diff --git a/lv_misc/lv_mem.c b/lv_misc/lv_mem.c index 2da12c84c..45b6af434 100644 --- a/lv_misc/lv_mem.c +++ b/lv_misc/lv_mem.c @@ -159,6 +159,9 @@ 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 return alloc; } @@ -241,6 +244,10 @@ 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 return new_p; } diff --git a/lv_misc/lv_mem.h b/lv_misc/lv_mem.h index ae224cfbd..a4c3188ce 100644 --- a/lv_misc/lv_mem.h +++ b/lv_misc/lv_mem.h @@ -22,6 +22,7 @@ extern "C" { #include #include +#include "lv_log.h" /********************* * DEFINES @@ -93,22 +94,20 @@ void lv_mem_monitor(lv_mem_monitor_t * mon_p); */ uint32_t lv_mem_get_size(const void * data); -/** - * Halt o NULL pointer - * p pointer to a memory - */ -static inline void lv_mem_assert(void *p) -{ - if(p == NULL) { - while(1); - } -} - /********************** * MACROS **********************/ +/** + * Halt on NULL pointer + * p pointer to a memory + */ +#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); }} +#endif #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/lv_misc/lv_task.c b/lv_misc/lv_task.c index 9efead715..bfbc1a67e 100644 --- a/lv_misc/lv_task.c +++ b/lv_misc/lv_task.c @@ -56,6 +56,11 @@ 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 + static uint32_t idle_period_start = 0; static uint32_t handler_start = 0; static uint32_t busy_time = 0; @@ -128,6 +133,10 @@ 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 } /** @@ -175,7 +184,6 @@ lv_task_t * lv_task_create(void (*task)(void *), uint32_t period, lv_task_prio_t new_lv_task->last_run = lv_tick_get(); return new_lv_task; - } /** diff --git a/lv_objx/lv_arc.c b/lv_objx/lv_arc.c index b26929d88..951175549 100644 --- a/lv_objx/lv_arc.c +++ b/lv_objx/lv_arc.c @@ -50,6 +50,11 @@ 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 + /*Create the ancestor of arc*/ lv_obj_t * new_arc = lv_obj_create(par, copy); lv_mem_assert(new_arc); @@ -85,6 +90,10 @@ 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 + return new_arc; } diff --git a/lv_objx/lv_bar.c b/lv_objx/lv_bar.c index 24ba5f2bd..1f8ca838c 100644 --- a/lv_objx/lv_bar.c +++ b/lv_objx/lv_bar.c @@ -52,6 +52,11 @@ 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 + /*Create the ancestor basic object*/ lv_obj_t * new_bar = lv_obj_create(par, copy); lv_mem_assert(new_bar); @@ -97,6 +102,11 @@ 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 + return new_bar; } diff --git a/lv_objx/lv_btn.c b/lv_objx/lv_btn.c index d59771105..12832b19e 100644 --- a/lv_objx/lv_btn.c +++ b/lv_objx/lv_btn.c @@ -67,6 +67,11 @@ 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_obj_t * new_btn; new_btn = lv_cont_create(par, copy); @@ -135,6 +140,11 @@ 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 + return new_btn; } diff --git a/lv_objx/lv_btnm.c b/lv_objx/lv_btnm.c index d1c39c45d..1519b286d 100644 --- a/lv_objx/lv_btnm.c +++ b/lv_objx/lv_btnm.c @@ -64,6 +64,11 @@ 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 + /*Create the ancestor object*/ lv_obj_t * new_btnm = lv_obj_create(par, copy); lv_mem_assert(new_btnm); @@ -121,6 +126,9 @@ 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 return new_btnm; } diff --git a/lv_objx/lv_calendar.c b/lv_objx/lv_calendar.c index c76d7d6f3..3078759e0 100644 --- a/lv_objx/lv_calendar.c +++ b/lv_objx/lv_calendar.c @@ -70,6 +70,11 @@ 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 + /*Create the ancestor of calendar*/ lv_obj_t * new_calendar = lv_obj_create(par, copy); lv_mem_assert(new_calendar); @@ -139,6 +144,11 @@ 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 + + return new_calendar; } diff --git a/lv_objx/lv_cb.c b/lv_objx/lv_cb.c index ba847397c..1c9f2f1a3 100644 --- a/lv_objx/lv_cb.c +++ b/lv_objx/lv_cb.c @@ -50,6 +50,11 @@ 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 + /*Create the ancestor basic object*/ lv_obj_t * new_cb = lv_btn_create(par, copy); lv_mem_assert(new_cb); @@ -105,6 +110,11 @@ 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 + + return new_cb; } diff --git a/lv_objx/lv_chart.c b/lv_objx/lv_chart.c index 7984d5027..ea03d543a 100644 --- a/lv_objx/lv_chart.c +++ b/lv_objx/lv_chart.c @@ -57,6 +57,11 @@ 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 + /*Create the ancestor basic object*/ lv_obj_t * new_chart = lv_obj_create(par, copy); lv_mem_assert(new_chart); @@ -111,6 +116,11 @@ 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 + + return new_chart; } diff --git a/lv_objx/lv_cont.c b/lv_objx/lv_cont.c index 2205dc133..e00b6c0ea 100644 --- a/lv_objx/lv_cont.c +++ b/lv_objx/lv_cont.c @@ -62,6 +62,11 @@ 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 + /*Create a basic object*/ lv_obj_t * new_cont = lv_obj_create(par, copy); lv_mem_assert(new_cont); @@ -101,6 +106,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 + return new_cont; } diff --git a/lv_objx/lv_ddlist.c b/lv_objx/lv_ddlist.c index 99621fb63..92bfab375 100644 --- a/lv_objx/lv_ddlist.c +++ b/lv_objx/lv_ddlist.c @@ -66,6 +66,11 @@ 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 + /*Create the ancestor drop down list*/ lv_obj_t * new_ddlist = lv_page_create(par, copy); lv_mem_assert(new_ddlist); @@ -138,6 +143,10 @@ 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 + return new_ddlist; } diff --git a/lv_objx/lv_gauge.c b/lv_objx/lv_gauge.c index 2bf20a526..2b54d7bf0 100644 --- a/lv_objx/lv_gauge.c +++ b/lv_objx/lv_gauge.c @@ -60,6 +60,11 @@ 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 + /*Create the ancestor gauge*/ lv_obj_t * new_gauge = lv_lmeter_create(par, copy); lv_mem_assert(new_gauge); @@ -111,6 +116,10 @@ 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 + return new_gauge; } diff --git a/lv_objx/lv_img.c b/lv_objx/lv_img.c index 06d72c28e..307f41c82 100644 --- a/lv_objx/lv_img.c +++ b/lv_objx/lv_img.c @@ -54,6 +54,11 @@ 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_obj_t * new_img = NULL; /*Create a basic object*/ @@ -97,6 +102,10 @@ 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 + return new_img; } diff --git a/lv_objx/lv_kb.c b/lv_objx/lv_kb.c index 6caf32538..bd4968433 100644 --- a/lv_objx/lv_kb.c +++ b/lv_objx/lv_kb.c @@ -75,6 +75,11 @@ 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 + /*Create the ancestor of keyboard*/ lv_obj_t * new_kb = lv_btnm_create(par, copy); lv_mem_assert(new_kb); @@ -132,6 +137,10 @@ 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 + return new_kb; } diff --git a/lv_objx/lv_label.c b/lv_objx/lv_label.c index 0f7883329..cc09357f9 100644 --- a/lv_objx/lv_label.c +++ b/lv_objx/lv_label.c @@ -64,6 +64,11 @@ 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 + /*Create a basic object*/ lv_obj_t * new_label = lv_obj_create(par, copy); lv_mem_assert(new_label); @@ -123,6 +128,12 @@ lv_obj_t * lv_label_create(lv_obj_t * par, lv_obj_t * copy) /*Refresh the style with new signal function*/ lv_obj_refresh_style(new_label); } + +#if USE_LV_LOG + lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Label create ready"); +#endif + + return new_label; } diff --git a/lv_objx/lv_led.c b/lv_objx/lv_led.c index 0c5c3a6f3..9526f50ab 100644 --- a/lv_objx/lv_led.c +++ b/lv_objx/lv_led.c @@ -52,6 +52,11 @@ 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 + /*Create the ancestor basic object*/ lv_obj_t * new_led = lv_obj_create(par, copy); lv_mem_assert(new_led); @@ -91,6 +96,10 @@ 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 + return new_led; } diff --git a/lv_objx/lv_line.c b/lv_objx/lv_line.c index 17dfd2b5d..40f0d8941 100644 --- a/lv_objx/lv_line.c +++ b/lv_objx/lv_line.c @@ -50,6 +50,11 @@ 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 + /*Create a basic object*/ lv_obj_t * new_line = lv_obj_create(par, copy); lv_mem_assert(new_line); @@ -87,6 +92,10 @@ 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 + return new_line; } diff --git a/lv_objx/lv_list.c b/lv_objx/lv_list.c index 4789c75c8..a20b01cb5 100644 --- a/lv_objx/lv_list.c +++ b/lv_objx/lv_list.c @@ -71,6 +71,11 @@ 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 + /*Create the ancestor basic object*/ lv_obj_t * new_list = lv_page_create(par, copy); lv_mem_assert(new_list); @@ -138,6 +143,10 @@ 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 + return new_list; } diff --git a/lv_objx/lv_lmeter.c b/lv_objx/lv_lmeter.c index ec7956871..913573ba7 100644 --- a/lv_objx/lv_lmeter.c +++ b/lv_objx/lv_lmeter.c @@ -52,6 +52,11 @@ 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 + /*Create the ancestor of line meter*/ lv_obj_t * new_lmeter = lv_obj_create(par, copy); lv_mem_assert(new_lmeter); @@ -100,6 +105,10 @@ 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 + return new_lmeter; } diff --git a/lv_objx/lv_mbox.c b/lv_objx/lv_mbox.c index 004e5c41f..f4de404ea 100644 --- a/lv_objx/lv_mbox.c +++ b/lv_objx/lv_mbox.c @@ -60,6 +60,11 @@ 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 + /*Create the ancestor message box*/ lv_obj_t * new_mbox = lv_cont_create(par, copy); lv_mem_assert(new_mbox); @@ -113,6 +118,10 @@ 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 + return new_mbox; } diff --git a/lv_objx/lv_objx_templ.c b/lv_objx/lv_objx_templ.c index 3a97803eb..c86c25c4f 100644 --- a/lv_objx/lv_objx_templ.c +++ b/lv_objx/lv_objx_templ.c @@ -53,6 +53,11 @@ 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 + /*Create the ancestor of template*/ /*TODO modify it to the ancestor create function */ lv_obj_t * new_templ = lv_ANCESTOR_create(par, copy); @@ -82,6 +87,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 return new_templ; } diff --git a/lv_objx/lv_page.c b/lv_objx/lv_page.c index 4dff3b2f0..c3eaea1f0 100644 --- a/lv_objx/lv_page.c +++ b/lv_objx/lv_page.c @@ -57,6 +57,11 @@ 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 + /*Create the ancestor object*/ lv_obj_t * new_page = lv_cont_create(par, copy); lv_mem_assert(new_page); @@ -140,6 +145,11 @@ 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 + + return new_page; } diff --git a/lv_objx/lv_preload.c b/lv_objx/lv_preload.c index 6df95c3a5..9867cac0e 100644 --- a/lv_objx/lv_preload.c +++ b/lv_objx/lv_preload.c @@ -55,6 +55,11 @@ 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 + /*Create the ancestor of pre loader*/ lv_obj_t * new_preload = lv_arc_create(par, copy); lv_mem_assert(new_preload); @@ -104,6 +109,10 @@ 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 + return new_preload; } diff --git a/lv_objx/lv_roller.c b/lv_objx/lv_roller.c index 0ae8a179c..671ac624c 100644 --- a/lv_objx/lv_roller.c +++ b/lv_objx/lv_roller.c @@ -60,6 +60,11 @@ 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 + /*Create the ancestor of roller*/ lv_obj_t * new_roller = lv_ddlist_create(par, copy); lv_mem_assert(new_roller); @@ -109,6 +114,10 @@ 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 + return new_roller; } diff --git a/lv_objx/lv_slider.c b/lv_objx/lv_slider.c index 835207a42..841952060 100644 --- a/lv_objx/lv_slider.c +++ b/lv_objx/lv_slider.c @@ -53,6 +53,11 @@ 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 + /*Create the ancestor slider*/ lv_obj_t * new_slider = lv_bar_create(par, copy); lv_mem_assert(new_slider); @@ -101,6 +106,10 @@ 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 + return new_slider; } diff --git a/lv_objx/lv_sw.c b/lv_objx/lv_sw.c index 457986c99..bac852a19 100644 --- a/lv_objx/lv_sw.c +++ b/lv_objx/lv_sw.c @@ -50,6 +50,11 @@ 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 + /*Create the ancestor of switch*/ lv_obj_t * new_sw = lv_slider_create(par, copy); lv_mem_assert(new_sw); @@ -100,6 +105,10 @@ 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 + return new_sw; } diff --git a/lv_objx/lv_ta.c b/lv_objx/lv_ta.c index 16fc0f1c3..38dbff42f 100644 --- a/lv_objx/lv_ta.c +++ b/lv_objx/lv_ta.c @@ -74,6 +74,11 @@ 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 + /*Create the ancestor object*/ lv_obj_t * new_ta = lv_page_create(par, copy); lv_mem_assert(new_ta); @@ -162,6 +167,10 @@ lv_obj_t * lv_ta_create(lv_obj_t * par, lv_obj_t * copy) lv_anim_create(&a); #endif + +#if USE_LV_LOG + lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, "Text area create ready"); +#endif return new_ta; } diff --git a/lv_objx/lv_tabview.c b/lv_objx/lv_tabview.c index 5ee4c4a87..f003ce430 100644 --- a/lv_objx/lv_tabview.c +++ b/lv_objx/lv_tabview.c @@ -66,6 +66,12 @@ 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 + + /*Create the ancestor of tab*/ lv_obj_t * new_tabview = lv_obj_create(par, copy); lv_mem_assert(new_tabview); @@ -170,6 +176,10 @@ 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 + return new_tabview; } @@ -811,7 +821,6 @@ static void tabview_realign(lv_obj_t * tabview) pages = lv_obj_get_child(ext->content, pages); } - lv_obj_align(ext->indic, ext->btns, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0); lv_tabview_set_tab_act(tabview, ext->tab_cur, false); diff --git a/lv_objx/lv_win.c b/lv_objx/lv_win.c index b3ab5f166..f1c4ada5b 100644 --- a/lv_objx/lv_win.c +++ b/lv_objx/lv_win.c @@ -46,6 +46,12 @@ 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 + + /*Create the ancestor object*/ lv_obj_t * new_win = lv_obj_create(par, copy); lv_mem_assert(new_win); @@ -96,16 +102,13 @@ lv_obj_t * lv_win_create(lv_obj_t * par, lv_obj_t * copy) lv_win_set_style(new_win, LV_WIN_STYLE_CONTENT_SCRL, th->win.content.scrl); lv_win_set_style(new_win, LV_WIN_STYLE_BTN_REL, th->win.btn.rel); lv_win_set_style(new_win, LV_WIN_STYLE_BTN_PR, th->win.btn.pr); - } else { lv_win_set_style(new_win, LV_WIN_STYLE_BG, &lv_style_plain); lv_win_set_style(new_win, LV_WIN_STYLE_CONTENT_BG, &lv_style_transp); lv_win_set_style(new_win, LV_WIN_STYLE_CONTENT_SCRL, &lv_style_transp); lv_win_set_style(new_win, LV_WIN_STYLE_HEADER, &lv_style_plain_color); - } - lv_obj_set_signal_func(new_win, lv_win_signal); lv_obj_set_size(new_win, LV_HOR_RES, LV_VER_RES); } @@ -137,6 +140,12 @@ 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 + return new_win; }