place some lv_log_add calls
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*********************/
|
||||
#include <stddef.h>
|
||||
#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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ extern "C" {
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#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
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user