fix(misc): correct the comment and code style (#2769)
and remove the redundant inclusion Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
4
lvgl.h
4
lvgl.h
@@ -25,15 +25,16 @@ extern "C" {
|
|||||||
#include "src/misc/lv_log.h"
|
#include "src/misc/lv_log.h"
|
||||||
#include "src/misc/lv_timer.h"
|
#include "src/misc/lv_timer.h"
|
||||||
#include "src/misc/lv_math.h"
|
#include "src/misc/lv_math.h"
|
||||||
|
#include "src/misc/lv_mem.h"
|
||||||
#include "src/misc/lv_async.h"
|
#include "src/misc/lv_async.h"
|
||||||
#include "src/misc/lv_anim_timeline.h"
|
#include "src/misc/lv_anim_timeline.h"
|
||||||
|
#include "src/misc/lv_printf.h"
|
||||||
|
|
||||||
#include "src/hal/lv_hal.h"
|
#include "src/hal/lv_hal.h"
|
||||||
|
|
||||||
#include "src/core/lv_obj.h"
|
#include "src/core/lv_obj.h"
|
||||||
#include "src/core/lv_group.h"
|
#include "src/core/lv_group.h"
|
||||||
#include "src/core/lv_indev.h"
|
#include "src/core/lv_indev.h"
|
||||||
|
|
||||||
#include "src/core/lv_refr.h"
|
#include "src/core/lv_refr.h"
|
||||||
#include "src/core/lv_disp.h"
|
#include "src/core/lv_disp.h"
|
||||||
#include "src/core/lv_theme.h"
|
#include "src/core/lv_theme.h"
|
||||||
@@ -41,7 +42,6 @@ extern "C" {
|
|||||||
#include "src/font/lv_font.h"
|
#include "src/font/lv_font.h"
|
||||||
#include "src/font/lv_font_loader.h"
|
#include "src/font/lv_font_loader.h"
|
||||||
#include "src/font/lv_font_fmt_txt.h"
|
#include "src/font/lv_font_fmt_txt.h"
|
||||||
#include "src/misc/lv_printf.h"
|
|
||||||
|
|
||||||
#include "src/widgets/lv_arc.h"
|
#include "src/widgets/lv_arc.h"
|
||||||
#include "src/widgets/lv_btn.h"
|
#include "src/widgets/lv_btn.h"
|
||||||
|
|||||||
@@ -8,10 +8,8 @@
|
|||||||
*********************/
|
*********************/
|
||||||
#include "lv_anim.h"
|
#include "lv_anim.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "../misc/lv_assert.h"
|
|
||||||
#include "../hal/lv_hal_tick.h"
|
#include "../hal/lv_hal_tick.h"
|
||||||
|
#include "lv_assert.h"
|
||||||
#include "lv_timer.h"
|
#include "lv_timer.h"
|
||||||
#include "lv_math.h"
|
#include "lv_math.h"
|
||||||
#include "lv_mem.h"
|
#include "lv_mem.h"
|
||||||
@@ -67,9 +65,9 @@ void _lv_anim_core_init(void)
|
|||||||
void lv_anim_init(lv_anim_t * a)
|
void lv_anim_init(lv_anim_t * a)
|
||||||
{
|
{
|
||||||
lv_memset_00(a, sizeof(lv_anim_t));
|
lv_memset_00(a, sizeof(lv_anim_t));
|
||||||
a->time = 500;
|
a->time = 500;
|
||||||
a->start_value = 0;
|
a->start_value = 0;
|
||||||
a->end_value = 100;
|
a->end_value = 100;
|
||||||
a->repeat_cnt = 1;
|
a->repeat_cnt = 1;
|
||||||
a->path_cb = lv_anim_path_linear;
|
a->path_cb = lv_anim_path_linear;
|
||||||
a->early_apply = 1;
|
a->early_apply = 1;
|
||||||
@@ -100,7 +98,7 @@ lv_anim_t * lv_anim_start(const lv_anim_t * a)
|
|||||||
/*Set the start value*/
|
/*Set the start value*/
|
||||||
if(new_anim->early_apply) {
|
if(new_anim->early_apply) {
|
||||||
if(new_anim->get_value_cb) {
|
if(new_anim->get_value_cb) {
|
||||||
int32_t v_ofs = new_anim->get_value_cb(new_anim);
|
int32_t v_ofs = new_anim->get_value_cb(new_anim);
|
||||||
new_anim->start_value += v_ofs;
|
new_anim->start_value += v_ofs;
|
||||||
new_anim->end_value += v_ofs;
|
new_anim->end_value += v_ofs;
|
||||||
}
|
}
|
||||||
@@ -151,7 +149,7 @@ bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb)
|
|||||||
_lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a);
|
_lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a);
|
||||||
lv_mem_free(a);
|
lv_mem_free(a);
|
||||||
anim_mark_list_change(); /*Read by `anim_timer`. It need to know if a delete occurred in
|
anim_mark_list_change(); /*Read by `anim_timer`. It need to know if a delete occurred in
|
||||||
the linked list*/
|
the linked list*/
|
||||||
del = true;
|
del = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +343,7 @@ int32_t lv_anim_path_step(const lv_anim_t * a)
|
|||||||
*/
|
*/
|
||||||
static void anim_timer(lv_timer_t * param)
|
static void anim_timer(lv_timer_t * param)
|
||||||
{
|
{
|
||||||
(void)param;
|
LV_UNUSED(param);
|
||||||
|
|
||||||
uint32_t elaps = lv_tick_elaps(last_timer_run);
|
uint32_t elaps = lv_tick_elaps(last_timer_run);
|
||||||
|
|
||||||
@@ -368,7 +366,7 @@ static void anim_timer(lv_timer_t * param)
|
|||||||
int32_t new_act_time = a->act_time + elaps;
|
int32_t new_act_time = a->act_time + elaps;
|
||||||
if(!a->start_cb_called && a->act_time <= 0 && new_act_time >= 0) {
|
if(!a->start_cb_called && a->act_time <= 0 && new_act_time >= 0) {
|
||||||
if(a->early_apply == 0 && a->get_value_cb) {
|
if(a->early_apply == 0 && a->get_value_cb) {
|
||||||
int32_t v_ofs = a->get_value_cb(a);
|
int32_t v_ofs = a->get_value_cb(a);
|
||||||
a->start_value += v_ofs;
|
a->start_value += v_ofs;
|
||||||
a->end_value += v_ofs;
|
a->end_value += v_ofs;
|
||||||
}
|
}
|
||||||
@@ -444,8 +442,7 @@ static void anim_ready_handler(lv_anim_t * a)
|
|||||||
/*Toggle the play back state*/
|
/*Toggle the play back state*/
|
||||||
a->playback_now = a->playback_now == 0 ? 1 : 0;
|
a->playback_now = a->playback_now == 0 ? 1 : 0;
|
||||||
/*Swap the start and end values*/
|
/*Swap the start and end values*/
|
||||||
int32_t tmp;
|
int32_t tmp = a->start_value;
|
||||||
tmp = a->start_value;
|
|
||||||
a->start_value = a->end_value;
|
a->start_value = a->end_value;
|
||||||
a->end_value = tmp;
|
a->end_value = tmp;
|
||||||
/*Swap the time and playback_time*/
|
/*Swap the time and playback_time*/
|
||||||
@@ -455,6 +452,7 @@ static void anim_ready_handler(lv_anim_t * a)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void anim_mark_list_change(void)
|
static void anim_mark_list_change(void)
|
||||||
{
|
{
|
||||||
anim_list_changed = true;
|
anim_list_changed = true;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@@ -173,7 +173,7 @@ static inline void lv_anim_set_values(lv_anim_t * a, int32_t start, int32_t end)
|
|||||||
* `lv_anim_t * ` as its first parameter instead of `void *`.
|
* `lv_anim_t * ` as its first parameter instead of `void *`.
|
||||||
* This function might be used when LVGL is bound to other languages because
|
* This function might be used when LVGL is bound to other languages because
|
||||||
* it's more consistent to have `lv_anim_t *` as first parameter.
|
* it's more consistent to have `lv_anim_t *` as first parameter.
|
||||||
* The variable to animate can be stored in the animation's `user_sata`
|
* The variable to animate can be stored in the animation's `user_data`
|
||||||
* @param a pointer to an initialized `lv_anim_t` variable
|
* @param a pointer to an initialized `lv_anim_t` variable
|
||||||
* @param exec_cb a function to execute.
|
* @param exec_cb a function to execute.
|
||||||
*/
|
*/
|
||||||
@@ -223,10 +223,11 @@ static inline void lv_anim_set_ready_cb(lv_anim_t * a, lv_anim_ready_cb_t ready_
|
|||||||
{
|
{
|
||||||
a->ready_cb = ready_cb;
|
a->ready_cb = ready_cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make the animation to play back to when the forward direction is ready
|
* Make the animation to play back to when the forward direction is ready
|
||||||
* @param a pointer to an initialized `lv_anim_t` variable
|
* @param a pointer to an initialized `lv_anim_t` variable
|
||||||
* @param time the duration of the playback animation in in milliseconds. 0: disable playback
|
* @param time the duration of the playback animation in milliseconds. 0: disable playback
|
||||||
*/
|
*/
|
||||||
static inline void lv_anim_set_playback_time(lv_anim_t * a, uint32_t time)
|
static inline void lv_anim_set_playback_time(lv_anim_t * a, uint32_t time)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*********************/
|
*********************/
|
||||||
#include "lv_anim_timeline.h"
|
#include "lv_anim_timeline.h"
|
||||||
#include "lv_mem.h"
|
#include "lv_mem.h"
|
||||||
#include "../misc/lv_assert.h"
|
#include "lv_assert.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ bool _lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area
|
|||||||
|
|
||||||
return union_ok;
|
return union_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join two areas into a third which involves the other two
|
* Join two areas into a third which involves the other two
|
||||||
* @param res_p pointer to an area, the result will be stored here
|
* @param res_p pointer to an area, the result will be stored here
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ extern "C" {
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include "../lv_conf_internal.h"
|
#include "../lv_conf_internal.h"
|
||||||
#include <string.h>
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ extern "C" {
|
|||||||
#include "../lv_conf_internal.h"
|
#include "../lv_conf_internal.h"
|
||||||
#include "lv_log.h"
|
#include "lv_log.h"
|
||||||
#include "lv_mem.h"
|
#include "lv_mem.h"
|
||||||
|
#include <stdbool.h>
|
||||||
#include LV_ASSERT_HANDLER_INCLUDE
|
#include LV_ASSERT_HANDLER_INCLUDE
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
@@ -34,21 +35,21 @@ extern "C" {
|
|||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
#define LV_ASSERT(expr) \
|
#define LV_ASSERT(expr) \
|
||||||
do { \
|
do { \
|
||||||
if(!(expr)) { \
|
if(!(expr)) { \
|
||||||
LV_LOG_ERROR("Asserted at expression: %s", #expr); \
|
LV_LOG_ERROR("Asserted at expression: %s", #expr); \
|
||||||
LV_ASSERT_HANDLER \
|
LV_ASSERT_HANDLER \
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while (0)
|
||||||
|
|
||||||
#define LV_ASSERT_MSG(expr, msg) \
|
#define LV_ASSERT_MSG(expr, msg) \
|
||||||
do { \
|
do { \
|
||||||
if(!(expr)) { \
|
if(!(expr)) { \
|
||||||
LV_LOG_ERROR("Asserted at expression: %s (%s)", #expr, msg); \
|
LV_LOG_ERROR("Asserted at expression: %s (%s)", #expr, msg); \
|
||||||
LV_ASSERT_HANDLER \
|
LV_ASSERT_HANDLER \
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while (0)
|
||||||
|
|
||||||
/*-----------------
|
/*-----------------
|
||||||
* ASSERTS
|
* ASSERTS
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
*********************/
|
*********************/
|
||||||
|
|
||||||
#include "lv_async.h"
|
#include "lv_async.h"
|
||||||
|
#include "lv_mem.h"
|
||||||
|
#include "lv_timer.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@@ -72,6 +74,5 @@ static void lv_async_timer_cb(lv_timer_t * timer)
|
|||||||
lv_async_info_t * info = (lv_async_info_t *)timer->user_data;
|
lv_async_info_t * info = (lv_async_info_t *)timer->user_data;
|
||||||
|
|
||||||
info->cb(info->user_data);
|
info->cb(info->user_data);
|
||||||
|
|
||||||
lv_mem_free(info);
|
lv_mem_free(info);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ extern "C" {
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
|
|
||||||
#include "lv_timer.h"
|
|
||||||
#include "lv_types.h"
|
#include "lv_types.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
LV_ATTRIBUTE_FAST_MEM void lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num)
|
LV_ATTRIBUTE_FAST_MEM void lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num)
|
||||||
{
|
{
|
||||||
#if LV_COLOR_DEPTH == 16
|
#if LV_COLOR_DEPTH == 16
|
||||||
uintptr_t buf_int = (uintptr_t) buf;
|
uintptr_t buf_int = (uintptr_t)buf;
|
||||||
if(buf_int & 0x3) {
|
if(buf_int & 0x3) {
|
||||||
*buf = color;
|
*buf = color;
|
||||||
buf++;
|
buf++;
|
||||||
@@ -73,7 +73,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_color_fill(lv_color_t * buf, lv_color_t color, uin
|
|||||||
while(px_num) {
|
while(px_num) {
|
||||||
*buf = color;
|
*buf = color;
|
||||||
buf++;
|
buf++;
|
||||||
px_num --;
|
px_num--;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
while(px_num > 16) {
|
while(px_num > 16) {
|
||||||
@@ -118,7 +118,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_color_fill(lv_color_t * buf, lv_color_t color, uin
|
|||||||
while(px_num) {
|
while(px_num) {
|
||||||
*buf = color;
|
*buf = color;
|
||||||
buf++;
|
buf++;
|
||||||
px_num --;
|
px_num--;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -367,5 +367,3 @@ lv_color_t lv_palette_darken(lv_palette_t p, uint8_t lvl)
|
|||||||
|
|
||||||
return colors[p][lvl];
|
return colors[p][lvl];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -471,11 +471,11 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix(lv_color_t c1, lv_co
|
|||||||
ret.full = (uint16_t)((result >> 16) | result);
|
ret.full = (uint16_t)((result >> 16) | result);
|
||||||
#elif LV_COLOR_DEPTH != 1
|
#elif LV_COLOR_DEPTH != 1
|
||||||
/*LV_COLOR_DEPTH == 8, 16 or 32*/
|
/*LV_COLOR_DEPTH == 8, 16 or 32*/
|
||||||
LV_COLOR_SET_R(ret, LV_UDIV255((uint16_t) LV_COLOR_GET_R(c1) * mix + LV_COLOR_GET_R(c2) *
|
LV_COLOR_SET_R(ret, LV_UDIV255((uint16_t)LV_COLOR_GET_R(c1) * mix + LV_COLOR_GET_R(c2) *
|
||||||
(255 - mix) + LV_COLOR_MIX_ROUND_OFS));
|
(255 - mix) + LV_COLOR_MIX_ROUND_OFS));
|
||||||
LV_COLOR_SET_G(ret, LV_UDIV255((uint16_t) LV_COLOR_GET_G(c1) * mix + LV_COLOR_GET_G(c2) *
|
LV_COLOR_SET_G(ret, LV_UDIV255((uint16_t)LV_COLOR_GET_G(c1) * mix + LV_COLOR_GET_G(c2) *
|
||||||
(255 - mix) + LV_COLOR_MIX_ROUND_OFS));
|
(255 - mix) + LV_COLOR_MIX_ROUND_OFS));
|
||||||
LV_COLOR_SET_B(ret, LV_UDIV255((uint16_t) LV_COLOR_GET_B(c1) * mix + LV_COLOR_GET_B(c2) *
|
LV_COLOR_SET_B(ret, LV_UDIV255((uint16_t)LV_COLOR_GET_B(c1) * mix + LV_COLOR_GET_B(c2) *
|
||||||
(255 - mix) + LV_COLOR_MIX_ROUND_OFS));
|
(255 - mix) + LV_COLOR_MIX_ROUND_OFS));
|
||||||
LV_COLOR_SET_A(ret, 0xFF);
|
LV_COLOR_SET_A(ret, 0xFF);
|
||||||
#else
|
#else
|
||||||
@@ -489,9 +489,9 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix(lv_color_t c1, lv_co
|
|||||||
LV_ATTRIBUTE_FAST_MEM static inline void lv_color_premult(lv_color_t c, uint8_t mix, uint16_t * out)
|
LV_ATTRIBUTE_FAST_MEM static inline void lv_color_premult(lv_color_t c, uint8_t mix, uint16_t * out)
|
||||||
{
|
{
|
||||||
#if LV_COLOR_DEPTH != 1
|
#if LV_COLOR_DEPTH != 1
|
||||||
out[0] = (uint16_t) LV_COLOR_GET_R(c) * mix;
|
out[0] = (uint16_t)LV_COLOR_GET_R(c) * mix;
|
||||||
out[1] = (uint16_t) LV_COLOR_GET_G(c) * mix;
|
out[1] = (uint16_t)LV_COLOR_GET_G(c) * mix;
|
||||||
out[2] = (uint16_t) LV_COLOR_GET_B(c) * mix;
|
out[2] = (uint16_t)LV_COLOR_GET_B(c) * mix;
|
||||||
#else
|
#else
|
||||||
(void) mix;
|
(void) mix;
|
||||||
/*Pre-multiplication can't be used with 1 bpp*/
|
/*Pre-multiplication can't be used with 1 bpp*/
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
*********************/
|
*********************/
|
||||||
#include "lv_fs.h"
|
#include "lv_fs.h"
|
||||||
|
|
||||||
#include "../misc/lv_assert.h"
|
|
||||||
#include "lv_ll.h"
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "lv_assert.h"
|
||||||
|
#include "lv_ll.h"
|
||||||
#include "lv_gc.h"
|
#include "lv_gc.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
@@ -163,26 +163,22 @@ lv_fs_res_t lv_fs_seek(lv_fs_file_t * file_p, uint32_t pos, lv_fs_whence_t whenc
|
|||||||
return LV_FS_RES_NOT_IMP;
|
return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_fs_res_t res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, pos, whence);
|
return file_p->drv->seek_cb(file_p->drv, file_p->file_d, pos, whence);
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_fs_res_t lv_fs_tell(lv_fs_file_t * file_p, uint32_t * pos)
|
lv_fs_res_t lv_fs_tell(lv_fs_file_t * file_p, uint32_t * pos)
|
||||||
{
|
{
|
||||||
|
*pos = 0;
|
||||||
|
|
||||||
if(file_p->drv == NULL) {
|
if(file_p->drv == NULL) {
|
||||||
*pos = 0;
|
|
||||||
return LV_FS_RES_INV_PARAM;
|
return LV_FS_RES_INV_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(file_p->drv->tell_cb == NULL) {
|
if(file_p->drv->tell_cb == NULL) {
|
||||||
*pos = 0;
|
|
||||||
return LV_FS_RES_NOT_IMP;
|
return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_fs_res_t res = file_p->drv->tell_cb(file_p->drv, file_p->file_d, pos);
|
return file_p->drv->tell_cb(file_p->drv, file_p->file_d, pos);
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path)
|
lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path)
|
||||||
@@ -221,19 +217,17 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path)
|
|||||||
|
|
||||||
lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn)
|
lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn)
|
||||||
{
|
{
|
||||||
|
fn[0] = '\0';
|
||||||
|
|
||||||
if(rddir_p->drv == NULL || rddir_p->dir_d == NULL) {
|
if(rddir_p->drv == NULL || rddir_p->dir_d == NULL) {
|
||||||
fn[0] = '\0';
|
|
||||||
return LV_FS_RES_INV_PARAM;
|
return LV_FS_RES_INV_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rddir_p->drv->dir_read_cb == NULL) {
|
if(rddir_p->drv->dir_read_cb == NULL) {
|
||||||
fn[0] = '\0';
|
|
||||||
return LV_FS_RES_NOT_IMP;
|
return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_fs_res_t res = rddir_p->drv->dir_read_cb(rddir_p->drv, rddir_p->dir_d, fn);
|
return rddir_p->drv->dir_read_cb(rddir_p->drv, rddir_p->dir_d, fn);
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_fs_res_t lv_fs_dir_close(lv_fs_dir_t * rddir_p)
|
lv_fs_res_t lv_fs_dir_close(lv_fs_dir_t * rddir_p)
|
||||||
@@ -362,6 +356,7 @@ const char * lv_fs_get_last(const char * path)
|
|||||||
|
|
||||||
return &path[i];
|
return &path[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -6,9 +6,7 @@
|
|||||||
/*********************
|
/*********************
|
||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
|
|
||||||
#include "lv_gc.h"
|
#include "lv_gc.h"
|
||||||
#include "string.h"
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
|
|||||||
@@ -13,11 +13,12 @@ extern "C" {
|
|||||||
/*********************
|
/*********************
|
||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
|
#include "../lv_conf_internal.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
|
||||||
#include "lv_mem.h"
|
#include "lv_mem.h"
|
||||||
#include "lv_ll.h"
|
#include "lv_ll.h"
|
||||||
#include "lv_timer.h"
|
#include "lv_timer.h"
|
||||||
|
#include "lv_types.h"
|
||||||
#include "../draw/lv_img_cache.h"
|
#include "../draw/lv_img_cache.h"
|
||||||
#include "../draw/lv_draw_mask.h"
|
#include "../draw/lv_draw_mask.h"
|
||||||
#include "../core/lv_obj_pos.h"
|
#include "../core/lv_obj_pos.h"
|
||||||
@@ -39,23 +40,23 @@ extern "C" {
|
|||||||
#define LV_DISPATCH10(f, t, n)
|
#define LV_DISPATCH10(f, t, n)
|
||||||
#define LV_DISPATCH11(f, t, n) LV_DISPATCH(f, t, n)
|
#define LV_DISPATCH11(f, t, n) LV_DISPATCH(f, t, n)
|
||||||
|
|
||||||
#define LV_ITERATE_ROOTS(f) \
|
#define LV_ITERATE_ROOTS(f) \
|
||||||
LV_DISPATCH(f, lv_ll_t, _lv_timer_ll) /*Linked list to store the lv_timers*/ \
|
LV_DISPATCH(f, lv_ll_t, _lv_timer_ll) /*Linked list to store the lv_timers*/ \
|
||||||
LV_DISPATCH(f, lv_ll_t, _lv_disp_ll) /*Linked list of display device*/ \
|
LV_DISPATCH(f, lv_ll_t, _lv_disp_ll) /*Linked list of display device*/ \
|
||||||
LV_DISPATCH(f, lv_ll_t, _lv_indev_ll) /*Linked list of input device*/ \
|
LV_DISPATCH(f, lv_ll_t, _lv_indev_ll) /*Linked list of input device*/ \
|
||||||
LV_DISPATCH(f, lv_ll_t, _lv_fsdrv_ll) \
|
LV_DISPATCH(f, lv_ll_t, _lv_fsdrv_ll) \
|
||||||
LV_DISPATCH(f, lv_ll_t, _lv_anim_ll) \
|
LV_DISPATCH(f, lv_ll_t, _lv_anim_ll) \
|
||||||
LV_DISPATCH(f, lv_ll_t, _lv_group_ll) \
|
LV_DISPATCH(f, lv_ll_t, _lv_group_ll) \
|
||||||
LV_DISPATCH(f, lv_ll_t, _lv_img_decoder_ll) \
|
LV_DISPATCH(f, lv_ll_t, _lv_img_decoder_ll) \
|
||||||
LV_DISPATCH(f, lv_ll_t, _lv_obj_style_trans_ll) \
|
LV_DISPATCH(f, lv_ll_t, _lv_obj_style_trans_ll) \
|
||||||
LV_DISPATCH(f, lv_layout_dsc_t *, _lv_layout_list) \
|
LV_DISPATCH(f, lv_layout_dsc_t *, _lv_layout_list) \
|
||||||
LV_DISPATCH_COND(f, _lv_img_cache_entry_t*, _lv_img_cache_array, LV_IMG_CACHE_DEF, 1) \
|
LV_DISPATCH_COND(f, _lv_img_cache_entry_t*, _lv_img_cache_array, LV_IMG_CACHE_DEF, 1) \
|
||||||
LV_DISPATCH_COND(f, _lv_img_cache_entry_t, _lv_img_cache_single, LV_IMG_CACHE_DEF, 0) \
|
LV_DISPATCH_COND(f, _lv_img_cache_entry_t, _lv_img_cache_single, LV_IMG_CACHE_DEF, 0) \
|
||||||
LV_DISPATCH(f, lv_timer_t*, _lv_timer_act) \
|
LV_DISPATCH(f, lv_timer_t*, _lv_timer_act) \
|
||||||
LV_DISPATCH(f, lv_mem_buf_arr_t , lv_mem_buf) \
|
LV_DISPATCH(f, lv_mem_buf_arr_t , lv_mem_buf) \
|
||||||
LV_DISPATCH_COND(f, _lv_draw_mask_radius_circle_dsc_arr_t , _lv_circle_cache, LV_DRAW_COMPLEX, 1) \
|
LV_DISPATCH_COND(f, _lv_draw_mask_radius_circle_dsc_arr_t , _lv_circle_cache, LV_DRAW_COMPLEX, 1) \
|
||||||
LV_DISPATCH_COND(f, _lv_draw_mask_saved_arr_t , _lv_draw_mask_list, LV_DRAW_COMPLEX, 1) \
|
LV_DISPATCH_COND(f, _lv_draw_mask_saved_arr_t , _lv_draw_mask_list, LV_DRAW_COMPLEX, 1) \
|
||||||
LV_DISPATCH(f, void * , _lv_theme_default_styles) \
|
LV_DISPATCH(f, void * , _lv_theme_default_styles) \
|
||||||
LV_DISPATCH_COND(f, uint8_t *, _lv_font_decompr_buf, LV_USE_FONT_COMPRESSED, 1)
|
LV_DISPATCH_COND(f, uint8_t *, _lv_font_decompr_buf, LV_USE_FONT_COMPRESSED, 1)
|
||||||
|
|
||||||
#define LV_DEFINE_ROOT(root_type, root_name) root_type root_name;
|
#define LV_DEFINE_ROOT(root_type, root_name) root_type root_name;
|
||||||
|
|||||||
@@ -7,9 +7,6 @@
|
|||||||
/*********************
|
/*********************
|
||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include <stdint.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "lv_ll.h"
|
#include "lv_ll.h"
|
||||||
#include "lv_mem.h"
|
#include "lv_mem.h"
|
||||||
|
|
||||||
@@ -44,7 +41,7 @@ static void node_set_next(lv_ll_t * ll_p, lv_ll_node_t * act, lv_ll_node_t * nex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize linked list
|
* Initialize linked list
|
||||||
* @param ll_dsc pointer to ll_dsc variable
|
* @param ll_p pointer to lv_ll_t variable
|
||||||
* @param node_size the size of 1 node in bytes
|
* @param node_size the size of 1 node in bytes
|
||||||
*/
|
*/
|
||||||
void _lv_ll_init(lv_ll_t * ll_p, uint32_t node_size)
|
void _lv_ll_init(lv_ll_t * ll_p, uint32_t node_size)
|
||||||
@@ -94,7 +91,7 @@ void * _lv_ll_ins_head(lv_ll_t * ll_p)
|
|||||||
* Insert a new node in front of the n_act node
|
* Insert a new node in front of the n_act node
|
||||||
* @param ll_p pointer to linked list
|
* @param ll_p pointer to linked list
|
||||||
* @param n_act pointer a node
|
* @param n_act pointer a node
|
||||||
* @return pointer to the new head
|
* @return pointer to the new node
|
||||||
*/
|
*/
|
||||||
void * _lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act)
|
void * _lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act)
|
||||||
{
|
{
|
||||||
@@ -215,7 +212,7 @@ void _lv_ll_clear(lv_ll_t * ll_p)
|
|||||||
* @param ll_new_p pointer to the new linked list
|
* @param ll_new_p pointer to the new linked list
|
||||||
* @param node pointer to a node
|
* @param node pointer to a node
|
||||||
* @param head true: be the head in the new list
|
* @param head true: be the head in the new list
|
||||||
* false be the head in the new list
|
* false be the tail in the new list
|
||||||
*/
|
*/
|
||||||
void _lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head)
|
void _lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head)
|
||||||
{
|
{
|
||||||
@@ -265,7 +262,7 @@ void * _lv_ll_get_head(const lv_ll_t * ll_p)
|
|||||||
/**
|
/**
|
||||||
* Return with tail node of the linked list
|
* Return with tail node of the linked list
|
||||||
* @param ll_p pointer to linked list
|
* @param ll_p pointer to linked list
|
||||||
* @return pointer to the head of 'll_p'
|
* @return pointer to the tail of 'll_p'
|
||||||
*/
|
*/
|
||||||
void * _lv_ll_get_tail(const lv_ll_t * ll_p)
|
void * _lv_ll_get_tail(const lv_ll_t * ll_p)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ typedef struct {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize linked list
|
* Initialize linked list
|
||||||
* @param ll_dsc pointer to ll_dsc variable
|
* @param ll_p pointer to lv_ll_t variable
|
||||||
* @param node_size the size of 1 node in bytes
|
* @param node_size the size of 1 node in bytes
|
||||||
*/
|
*/
|
||||||
void _lv_ll_init(lv_ll_t * ll_p, uint32_t node_size);
|
void _lv_ll_init(lv_ll_t * ll_p, uint32_t node_size);
|
||||||
@@ -57,7 +57,7 @@ void * _lv_ll_ins_head(lv_ll_t * ll_p);
|
|||||||
* Insert a new node in front of the n_act node
|
* Insert a new node in front of the n_act node
|
||||||
* @param ll_p pointer to linked list
|
* @param ll_p pointer to linked list
|
||||||
* @param n_act pointer a node
|
* @param n_act pointer a node
|
||||||
* @return pointer to the new head
|
* @return pointer to the new node
|
||||||
*/
|
*/
|
||||||
void * _lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act);
|
void * _lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act);
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ void _lv_ll_clear(lv_ll_t * ll_p);
|
|||||||
* @param ll_new_p pointer to the new linked list
|
* @param ll_new_p pointer to the new linked list
|
||||||
* @param node pointer to a node
|
* @param node pointer to a node
|
||||||
* @param head true: be the head in the new list
|
* @param head true: be the head in the new list
|
||||||
* false be the head in the new list
|
* false be the tail in the new list
|
||||||
*/
|
*/
|
||||||
void _lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head);
|
void _lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head);
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ void * _lv_ll_get_head(const lv_ll_t * ll_p);
|
|||||||
/**
|
/**
|
||||||
* Return with tail node of the linked list
|
* Return with tail node of the linked list
|
||||||
* @param ll_p pointer to linked list
|
* @param ll_p pointer to linked list
|
||||||
* @return pointer to the head of 'll_p'
|
* @return pointer to the tail of 'll_p'
|
||||||
*/
|
*/
|
||||||
void * _lv_ll_get_tail(const lv_ll_t * ll_p);
|
void * _lv_ll_get_tail(const lv_ll_t * ll_p);
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include "lv_math.h"
|
#include "lv_math.h"
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ int64_t lv_pow(int64_t base, int8_t exp);
|
|||||||
* @param max_out max output range
|
* @param max_out max output range
|
||||||
* @return the mapped number
|
* @return the mapped number
|
||||||
*/
|
*/
|
||||||
int32_t lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min, int32_t max);
|
int32_t lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min_out, int32_t max_out);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a pseudo random number in the given range
|
* Get a pseudo random number in the given range
|
||||||
@@ -131,10 +131,10 @@ uint32_t lv_rand(uint32_t min, uint32_t max);
|
|||||||
#define LV_ABS(x) ((x) > 0 ? (x) : (-(x)))
|
#define LV_ABS(x) ((x) > 0 ? (x) : (-(x)))
|
||||||
#define LV_UDIV255(x) (((x) * 0x8081U) >> 0x17)
|
#define LV_UDIV255(x) (((x) * 0x8081U) >> 0x17)
|
||||||
|
|
||||||
#define LV_IS_SIGNED(t) (((t)(-1)) < ((t) 0))
|
#define LV_IS_SIGNED(t) (((t)(-1)) < ((t)0))
|
||||||
#define LV_UMAX_OF(t) (((0x1ULL << ((sizeof(t) * 8ULL) - 1ULL)) - 1ULL) | (0xFULL << ((sizeof(t) * 8ULL) - 4ULL)))
|
#define LV_UMAX_OF(t) (((0x1ULL << ((sizeof(t) * 8ULL) - 1ULL)) - 1ULL) | (0xFULL << ((sizeof(t) * 8ULL) - 4ULL)))
|
||||||
#define LV_SMAX_OF(t) (((0x1ULL << ((sizeof(t) * 8ULL) - 1ULL)) - 1ULL) | (0x7ULL << ((sizeof(t) * 8ULL) - 4ULL)))
|
#define LV_SMAX_OF(t) (((0x1ULL << ((sizeof(t) * 8ULL) - 1ULL)) - 1ULL) | (0x7ULL << ((sizeof(t) * 8ULL) - 4ULL)))
|
||||||
#define LV_MAX_OF(t) ((unsigned long) (LV_IS_SIGNED(t) ? LV_SMAX_OF(t) : LV_UMAX_OF(t)))
|
#define LV_MAX_OF(t) ((unsigned long)(LV_IS_SIGNED(t) ? LV_SMAX_OF(t) : LV_UMAX_OF(t)))
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /*extern "C"*/
|
} /*extern "C"*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "lv_tlsf.h"
|
#include "lv_tlsf.h"
|
||||||
#include "lv_gc.h"
|
#include "lv_gc.h"
|
||||||
#include "lv_assert.h"
|
#include "lv_assert.h"
|
||||||
#include <string.h>
|
#include "lv_log.h"
|
||||||
|
|
||||||
#if LV_MEM_CUSTOM != 0
|
#if LV_MEM_CUSTOM != 0
|
||||||
#include LV_MEM_CUSTOM_INCLUDE
|
#include LV_MEM_CUSTOM_INCLUDE
|
||||||
@@ -134,10 +134,6 @@ void * lv_mem_alloc(size_t size)
|
|||||||
void * alloc = LV_MEM_CUSTOM_ALLOC(size);
|
void * alloc = LV_MEM_CUSTOM_ALLOC(size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_MEM_ADD_JUNK
|
|
||||||
if(alloc != NULL) lv_memset(alloc, 0xaa, size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(alloc == NULL) {
|
if(alloc == NULL) {
|
||||||
LV_LOG_ERROR("couldn't allocate memory (%lu bytes)", (unsigned long)size);
|
LV_LOG_ERROR("couldn't allocate memory (%lu bytes)", (unsigned long)size);
|
||||||
lv_mem_monitor_t mon;
|
lv_mem_monitor_t mon;
|
||||||
@@ -146,6 +142,11 @@ void * lv_mem_alloc(size_t size)
|
|||||||
(int)(mon.total_size - mon.free_size), mon.used_pct, mon.frag_pct,
|
(int)(mon.total_size - mon.free_size), mon.used_pct, mon.frag_pct,
|
||||||
(int)mon.free_biggest_size);
|
(int)mon.free_biggest_size);
|
||||||
}
|
}
|
||||||
|
#if LV_MEM_ADD_JUNK
|
||||||
|
else {
|
||||||
|
lv_memset(alloc, 0xaa, size);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
MEM_TRACE("allocated at %p", alloc);
|
MEM_TRACE("allocated at %p", alloc);
|
||||||
return alloc;
|
return alloc;
|
||||||
@@ -227,7 +228,7 @@ lv_res_t lv_mem_test(void)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Give information about the work memory of dynamic allocation
|
* Give information about the work memory of dynamic allocation
|
||||||
* @param mon_p pointer to a dm_mon_p variable,
|
* @param mon_p pointer to a lv_mem_monitor_t variable,
|
||||||
* the result of the analysis will be stored here
|
* the result of the analysis will be stored here
|
||||||
*/
|
*/
|
||||||
void lv_mem_monitor(lv_mem_monitor_t * mon_p)
|
void lv_mem_monitor(lv_mem_monitor_t * mon_p)
|
||||||
|
|||||||
@@ -17,12 +17,9 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "lv_log.h"
|
|
||||||
#include "lv_types.h"
|
|
||||||
|
|
||||||
#if LV_MEMCPY_MEMSET_STD
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
|
||||||
|
#include "lv_types.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@@ -99,7 +96,7 @@ lv_res_t lv_mem_test(void);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Give information about the work memory of dynamic allocation
|
* Give information about the work memory of dynamic allocation
|
||||||
* @param mon_p pointer to a dm_mon_p variable,
|
* @param mon_p pointer to a lv_mem_monitor_t variable,
|
||||||
* the result of the analysis will be stored here
|
* the result of the analysis will be stored here
|
||||||
*/
|
*/
|
||||||
void lv_mem_monitor(lv_mem_monitor_t * mon_p);
|
void lv_mem_monitor(lv_mem_monitor_t * mon_p);
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
#if LV_SPRINTF_CUSTOM == 0
|
#if LV_SPRINTF_CUSTOM == 0
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#define PRINTF_DISABLE_SUPPORT_FLOAT (!LV_SPRINTF_USE_FLOAT)
|
#define PRINTF_DISABLE_SUPPORT_FLOAT (!LV_SPRINTF_USE_FLOAT)
|
||||||
|
|
||||||
|
|||||||
@@ -295,6 +295,7 @@ uint8_t _lv_style_get_prop_group(lv_style_prop_t prop)
|
|||||||
if(group > 7) group = 7; /*The MSB marks all the custom properties*/
|
if(group > 7) group = 7; /*The MSB marks all the custom properties*/
|
||||||
return (uint8_t)group;
|
return (uint8_t)group;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -6,9 +6,10 @@
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include "lv_timer.h"
|
#include "lv_timer.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include "../misc/lv_assert.h"
|
|
||||||
#include "../hal/lv_hal_tick.h"
|
#include "../hal/lv_hal_tick.h"
|
||||||
|
#include "lv_assert.h"
|
||||||
|
#include "lv_mem.h"
|
||||||
|
#include "lv_ll.h"
|
||||||
#include "lv_gc.h"
|
#include "lv_gc.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
@@ -292,7 +293,7 @@ lv_timer_t * lv_timer_get_next(lv_timer_t * timer)
|
|||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute timer if its priority is appropriate
|
* Execute timer if its remaining time is zero
|
||||||
* @param timer pointer to lv_timer
|
* @param timer pointer to lv_timer
|
||||||
* @return true: execute, false: not executed
|
* @return true: execute, false: not executed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "lv_mem.h"
|
|
||||||
#include "lv_ll.h"
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
#if LV_MEM_CUSTOM == 0
|
#if LV_MEM_CUSTOM == 0
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stddef.h>
|
|
||||||
#include "lv_tlsf.h"
|
#include "lv_tlsf.h"
|
||||||
#include "lv_mem.h"
|
#include "lv_mem.h"
|
||||||
#include "lv_log.h"
|
#include "lv_log.h"
|
||||||
#include "lv_assert.h"
|
#include "lv_assert.h"
|
||||||
|
|
||||||
#undef printf
|
#undef printf
|
||||||
#define printf LV_LOG_ERROR
|
#define printf LV_LOG_ERROR
|
||||||
|
|
||||||
@@ -887,7 +887,7 @@ int lv_tlsf_check(lv_tlsf_t tlsf)
|
|||||||
|
|
||||||
static void default_walker(void * ptr, size_t size, int used, void * user)
|
static void default_walker(void * ptr, size_t size, int used, void * user)
|
||||||
{
|
{
|
||||||
(void)user;
|
LV_UNUSED(user);
|
||||||
printf("\t%p %s size: %x (%p)\n", ptr, used ? "used" : "free", (unsigned int)size, (void *)block_from_ptr(ptr));
|
printf("\t%p %s size: %x (%p)\n", ptr, used ? "used" : "free", (unsigned int)size, (void *)block_from_ptr(ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1087,7 +1087,7 @@ lv_tlsf_t lv_tlsf_create_with_pool(void * mem, size_t bytes)
|
|||||||
void lv_tlsf_destroy(lv_tlsf_t tlsf)
|
void lv_tlsf_destroy(lv_tlsf_t tlsf)
|
||||||
{
|
{
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
(void)tlsf;
|
LV_UNUSED(tlsf);
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_pool_t lv_tlsf_get_pool(lv_tlsf_t tlsf)
|
lv_pool_t lv_tlsf_get_pool(lv_tlsf_t tlsf)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include "../lv_conf_internal.h"
|
#include "../lv_conf_internal.h"
|
||||||
#if LV_MEM_CUSTOM == 0
|
#if LV_MEM_CUSTOM == 0
|
||||||
|
|
||||||
#ifndef INCLUDED_tlsf
|
#ifndef LV_TLSF_H
|
||||||
#define INCLUDED_tlsf
|
#define LV_TLSF_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Two Level Segregated Fit memory allocator, version 3.1.
|
** Two Level Segregated Fit memory allocator, version 3.1.
|
||||||
@@ -90,6 +90,6 @@ int lv_tlsf_check_pool(lv_pool_t pool);
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif /*LV_TLSF_H*/
|
||||||
|
|
||||||
#endif /* LV_MEM_CUSTOM == 0 */
|
#endif /* LV_MEM_CUSTOM == 0 */
|
||||||
|
|||||||
@@ -813,7 +813,7 @@ static uint32_t lv_txt_iso8859_1_prev(const char * txt, uint32_t * i)
|
|||||||
*/
|
*/
|
||||||
static uint32_t lv_txt_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id)
|
static uint32_t lv_txt_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id)
|
||||||
{
|
{
|
||||||
(void)txt; /*Unused*/
|
LV_UNUSED(txt); /*Unused*/
|
||||||
return utf8_id; /*In Non encoded no difference*/
|
return utf8_id; /*In Non encoded no difference*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -826,7 +826,7 @@ static uint32_t lv_txt_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id)
|
|||||||
*/
|
*/
|
||||||
static uint32_t lv_txt_iso8859_1_get_char_id(const char * txt, uint32_t byte_id)
|
static uint32_t lv_txt_iso8859_1_get_char_id(const char * txt, uint32_t byte_id)
|
||||||
{
|
{
|
||||||
(void)txt; /*Unused*/
|
LV_UNUSED(txt); /*Unused*/
|
||||||
return byte_id; /*In Non encoded no difference*/
|
return byte_id; /*In Non encoded no difference*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
LV_RES_INV = 0, /*Typically indicates that the object is deleted (become invalid) in the action
|
LV_RES_INV = 0, /*Typically indicates that the object is deleted (become invalid) in the action
|
||||||
function or an operation was failed*/
|
function or an operation was failed*/
|
||||||
LV_RES_OK, /*The object is valid (no deleted) after the action*/
|
LV_RES_OK, /*The object is valid (no deleted) after the action*/
|
||||||
};
|
};
|
||||||
typedef uint8_t lv_res_t;
|
typedef uint8_t lv_res_t;
|
||||||
@@ -69,7 +69,7 @@ typedef uint32_t lv_uintptr_t;
|
|||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
#define LV_UNUSED(x) ((void) x)
|
#define LV_UNUSED(x) ((void)x)
|
||||||
|
|
||||||
#define _LV_CONCAT(x, y) x ## y
|
#define _LV_CONCAT(x, y) x ## y
|
||||||
#define LV_CONCAT(x, y) _LV_CONCAT(x, y)
|
#define LV_CONCAT(x, y) _LV_CONCAT(x, y)
|
||||||
|
|||||||
Reference in New Issue
Block a user