fix(conf): fix a lot of new config realted issues

This commit is contained in:
Gabor Kiss-Vamosi
2022-07-19 17:21:19 +02:00
parent 09301a0970
commit 6104855491
32 changed files with 80 additions and 192 deletions

View File

@@ -10,7 +10,7 @@
#if LV_USE_DEMO_WIDGETS #if LV_USE_DEMO_WIDGETS
#if LV_MEM_CUSTOM == 0 && LV_MEM_SIZE < (38ul * 1024ul) #if LV_USE_BUILTIN_MALLOC && LV_MEM_SIZE < (38ul * 1024ul)
#error Insufficient memory for lv_demo_widgets. Please set LV_MEM_SIZE to at least 38KB (38ul * 1024ul). 48KB is recommended. #error Insufficient memory for lv_demo_widgets. Please set LV_MEM_SIZE to at least 38KB (38ul * 1024ul). 48KB is recommended.
#endif #endif

View File

@@ -710,7 +710,7 @@
====================*/ ====================*/
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */ /*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#define LV_USE_DEMO_WIDGETS 1 #define LV_USE_DEMO_WIDGETS 0
#if LV_USE_DEMO_WIDGETS #if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW 0 #define LV_DEMO_WIDGETS_SLIDESHOW 0
#endif #endif

View File

@@ -187,7 +187,7 @@ void lv_init(void)
LV_LOG_TRACE("finished"); LV_LOG_TRACE("finished");
} }
#if LV_ENABLE_GC || !LV_MEM_CUSTOM #if LV_ENABLE_GC || LV_USE_BUILTIN_MALLOC
void lv_deinit(void) void lv_deinit(void)
{ {

View File

@@ -201,7 +201,7 @@ typedef struct _lv_obj_t {
*/ */
void lv_init(void); void lv_init(void);
#if LV_ENABLE_GC || !LV_MEM_CUSTOM #if LV_ENABLE_GC || LV_USE_BUILTIN_MALLOC
/** /**
* Deinit the 'lv' library * Deinit the 'lv' library

View File

@@ -384,7 +384,7 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
fps_limit = 1000 / disp_refr->refr_timer->period; fps_limit = 1000 / disp_refr->refr_timer->period;
} }
else { else {
fps_limit = 1000 / LV_DISP_DEF_REFR_PERIOD; fps_limit = 1000 / 33;
} }
if(perf_monitor.elaps_sum == 0) { if(perf_monitor.elaps_sum == 0) {
@@ -409,7 +409,7 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
} }
#endif #endif
#if LV_USE_MEM_MONITOR && LV_MEM_CUSTOM == 0 && LV_USE_LABEL #if LV_USE_MEM_MONITOR && LV_USE_BUILTIN_MALLOC && LV_USE_LABEL
lv_obj_t * mem_label = mem_monitor.mem_label; lv_obj_t * mem_label = mem_monitor.mem_label;
if(mem_label == NULL) { if(mem_label == NULL) {
mem_label = lv_label_create(lv_layer_sys()); mem_label = lv_label_create(lv_layer_sys());

View File

@@ -39,10 +39,6 @@
* DEFINES * DEFINES
*********************/ *********************/
#if LV_COLOR_16_SWAP
#error Color swap not implemented. Disable LV_COLOR_16_SWAP feature.
#endif
#if LV_COLOR_DEPTH==16 #if LV_COLOR_DEPTH==16
#define PXP_OUT_PIXEL_FORMAT kPXP_OutputPixelFormatRGB565 #define PXP_OUT_PIXEL_FORMAT kPXP_OutputPixelFormatRGB565
#define PXP_AS_PIXEL_FORMAT kPXP_AsPixelFormatRGB565 #define PXP_AS_PIXEL_FORMAT kPXP_AsPixelFormatRGB565

View File

@@ -17,11 +17,6 @@
* DEFINES * DEFINES
*********************/ *********************/
#if LV_COLOR_16_SWAP
// TODO: F7 has red blue swap bit in control register for all layers and output
#error "Can't use DMA2D with LV_COLOR_16_SWAP 1"
#endif
#if LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 8
#error "Can't use DMA2D with LV_COLOR_DEPTH == 8" #error "Can't use DMA2D with LV_COLOR_DEPTH == 8"
#endif #endif

View File

@@ -356,7 +356,7 @@ static inline void set_px_argb(uint8_t * buf, lv_color_t color, lv_opa_t opa)
lv_color_t bg_color; lv_color_t bg_color;
lv_color_t res_color; lv_color_t res_color;
lv_opa_t bg_opa = buf[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; lv_opa_t bg_opa = buf[LV_IMG_PX_SIZE_ALPHA_BYTE - 1];
#if LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
bg_color.full = buf[0]; bg_color.full = buf[0];
lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf[1]); lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf[1]);
if(buf[1] <= LV_OPA_MIN) return; if(buf[1] <= LV_OPA_MIN) return;
@@ -388,7 +388,7 @@ static inline void set_px_argb_blend(uint8_t * buf, lv_color_t color, lv_opa_t o
lv_color_t bg_color; lv_color_t bg_color;
/*Get the BG color*/ /*Get the BG color*/
#if LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
if(buf[1] <= LV_OPA_MIN) return; if(buf[1] <= LV_OPA_MIN) return;
bg_color.full = buf[0]; bg_color.full = buf[0];
#elif LV_COLOR_DEPTH == 16 #elif LV_COLOR_DEPTH == 16
@@ -408,8 +408,8 @@ static inline void set_px_argb_blend(uint8_t * buf, lv_color_t color, lv_opa_t o
} }
/*Set the result color*/ /*Set the result color*/
#if LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
buf[0] = res_color.full; buf[0] = last_res_color.full;
#elif LV_COLOR_DEPTH == 16 #elif LV_COLOR_DEPTH == 16
buf[0] = last_res_color.full & 0xff; buf[0] = last_res_color.full & 0xff;
buf[1] = last_res_color.full >> 8; buf[1] = last_res_color.full >> 8;
@@ -936,16 +936,8 @@ static inline lv_color_t color_blend_true_color_additive(lv_color_t fg, lv_color
tmp = bg.ch.green + fg.ch.green; tmp = bg.ch.green + fg.ch.green;
fg.ch.green = LV_MIN(tmp, 7); fg.ch.green = LV_MIN(tmp, 7);
#elif LV_COLOR_DEPTH == 16 #elif LV_COLOR_DEPTH == 16
#if LV_COLOR_16_SWAP == 0
tmp = bg.ch.green + fg.ch.green; tmp = bg.ch.green + fg.ch.green;
fg.ch.green = LV_MIN(tmp, 63); fg.ch.green = LV_MIN(tmp, 63);
#else
tmp = (bg.ch.green_h << 3) + bg.ch.green_l + (fg.ch.green_h << 3) + fg.ch.green_l;
tmp = LV_MIN(tmp, 63);
fg.ch.green_h = tmp >> 3;
fg.ch.green_l = tmp & 0x7;
#endif
#elif LV_COLOR_DEPTH == 32 #elif LV_COLOR_DEPTH == 32
tmp = bg.ch.green + fg.ch.green; tmp = bg.ch.green + fg.ch.green;
fg.ch.green = LV_MIN(tmp, 255); fg.ch.green = LV_MIN(tmp, 255);
@@ -974,15 +966,8 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
tmp = bg.ch.red - fg.ch.red; tmp = bg.ch.red - fg.ch.red;
fg.ch.red = LV_MAX(tmp, 0); fg.ch.red = LV_MAX(tmp, 0);
#if LV_COLOR_16_SWAP == 0
tmp = bg.ch.green - fg.ch.green; tmp = bg.ch.green - fg.ch.green;
fg.ch.green = LV_MAX(tmp, 0); fg.ch.green = LV_MAX(tmp, 0);
#else
tmp = (bg.ch.green_h << 3) + bg.ch.green_l + (fg.ch.green_h << 3) + fg.ch.green_l;
tmp = LV_MAX(tmp, 0);
fg.ch.green_h = tmp >> 3;
fg.ch.green_l = tmp & 0x7;
#endif
tmp = bg.ch.blue - fg.ch.blue; tmp = bg.ch.blue - fg.ch.blue;
fg.ch.blue = LV_MAX(tmp, 0); fg.ch.blue = LV_MAX(tmp, 0);

View File

@@ -438,11 +438,7 @@ static void draw_letter_subpx(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_
uint8_t font_rgb[3]; uint8_t font_rgb[3];
lv_color_t color = dsc->color; lv_color_t color = dsc->color;
#if LV_COLOR_16_SWAP == 0
uint8_t txt_rgb[3] = {color.ch.red, color.ch.green, color.ch.blue}; uint8_t txt_rgb[3] = {color.ch.red, color.ch.green, color.ch.blue};
#else
uint8_t txt_rgb[3] = {color.ch.red, (color.ch.green_h << 3) + color.ch.green_l, color.ch.blue};
#endif
lv_draw_sw_blend_dsc_t blend_dsc; lv_draw_sw_blend_dsc_t blend_dsc;
lv_memzero(&blend_dsc, sizeof(blend_dsc)); lv_memzero(&blend_dsc, sizeof(blend_dsc));
@@ -481,14 +477,7 @@ static void draw_letter_subpx(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_
subpx_cnt = 0; subpx_cnt = 0;
lv_color_t res_color; lv_color_t res_color;
#if LV_COLOR_16_SWAP == 0
uint8_t bg_rgb[3] = {dest_buf_tmp->ch.red, dest_buf_tmp->ch.green, dest_buf_tmp->ch.blue}; uint8_t bg_rgb[3] = {dest_buf_tmp->ch.red, dest_buf_tmp->ch.green, dest_buf_tmp->ch.blue};
#else
uint8_t bg_rgb[3] = {dest_buf_tmp->ch.red,
(dest_buf_tmp->ch.green_h << 3) + dest_buf_tmp->ch.green_l,
dest_buf_tmp->ch.blue
};
#endif
#if LV_DRAW_SW_FONT_SUBPX_BGR #if LV_DRAW_SW_FONT_SUBPX_BGR
res_color.ch.blue = (uint32_t)((uint32_t)txt_rgb[0] * font_rgb[0] + (bg_rgb[0] * (255 - font_rgb[0]))) >> 8; res_color.ch.blue = (uint32_t)((uint32_t)txt_rgb[0] * font_rgb[0] + (bg_rgb[0] * (255 - font_rgb[0]))) >> 8;
@@ -498,13 +487,7 @@ static void draw_letter_subpx(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_
res_color.ch.blue = (uint32_t)((uint16_t)txt_rgb[2] * font_rgb[2] + (bg_rgb[2] * (255 - font_rgb[2]))) >> 8; res_color.ch.blue = (uint32_t)((uint16_t)txt_rgb[2] * font_rgb[2] + (bg_rgb[2] * (255 - font_rgb[2]))) >> 8;
#endif #endif
#if LV_COLOR_16_SWAP == 0
res_color.ch.green = (uint32_t)((uint32_t)txt_rgb[1] * font_rgb[1] + (bg_rgb[1] * (255 - font_rgb[1]))) >> 8; res_color.ch.green = (uint32_t)((uint32_t)txt_rgb[1] * font_rgb[1] + (bg_rgb[1] * (255 - font_rgb[1]))) >> 8;
#else
uint8_t green = (uint32_t)((uint32_t)txt_rgb[1] * font_rgb[1] + (bg_rgb[1] * (255 - font_rgb[1]))) >> 8;
res_color.ch.green_h = green >> 3;
res_color.ch.green_l = green & 0x7;
#endif
#if LV_COLOR_DEPTH == 32 #if LV_COLOR_DEPTH == 32
res_color.ch.alpha = 0xff; res_color.ch.alpha = 0xff;

View File

@@ -181,7 +181,7 @@ static void rgb_no_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, l
} }
else { else {
#if LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
const uint8_t * src_tmp = src; const uint8_t * src_tmp = src;
src_tmp += ys_int * src_stride + xs_int; src_tmp += ys_int * src_stride + xs_int;
cbuf[x].full = src_tmp[0]; cbuf[x].full = src_tmp[0];
@@ -222,7 +222,7 @@ static void argb_no_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h,
const uint8_t * src_tmp = src; const uint8_t * src_tmp = src;
src_tmp += (ys_int * src_stride * LV_IMG_PX_SIZE_ALPHA_BYTE) + xs_int * LV_IMG_PX_SIZE_ALPHA_BYTE; src_tmp += (ys_int * src_stride * LV_IMG_PX_SIZE_ALPHA_BYTE) + xs_int * LV_IMG_PX_SIZE_ALPHA_BYTE;
#if LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
cbuf[x].full = src_tmp[0]; cbuf[x].full = src_tmp[0];
#elif LV_COLOR_DEPTH == 16 #elif LV_COLOR_DEPTH == 16
cbuf[x].full = src_tmp[0] + (src_tmp[1] << 8); cbuf[x].full = src_tmp[0] + (src_tmp[1] << 8);
@@ -397,7 +397,7 @@ static void argb_and_rgb_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t sr
if(abuf[x] == 0x00) continue; if(abuf[x] == 0x00) continue;
#if LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
c_base.full = px_base[0]; c_base.full = px_base[0];
c_ver.full = px_ver[0]; c_ver.full = px_ver[0];
c_hor.full = px_hor[0]; c_hor.full = px_hor[0];
@@ -430,7 +430,7 @@ static void argb_and_rgb_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t sr
} }
/*Partially out of the image*/ /*Partially out of the image*/
else { else {
#if LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
cbuf[x].full = src_tmp[0]; cbuf[x].full = src_tmp[0];
#elif LV_COLOR_DEPTH == 16 #elif LV_COLOR_DEPTH == 16
cbuf[x].full = src_tmp[0] + (src_tmp[1] << 8); cbuf[x].full = src_tmp[0] + (src_tmp[1] << 8);

View File

@@ -203,14 +203,8 @@ static lv_res_t decoder_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc
lv_fs_seek(&b->f, p, LV_FS_SEEK_SET); lv_fs_seek(&b->f, p, LV_FS_SEEK_SET);
lv_fs_read(&b->f, buf, len * (b->bpp / 8), NULL); lv_fs_read(&b->f, buf, len * (b->bpp / 8), NULL);
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 1
for(unsigned int i = 0; i < len * (b->bpp / 8); i += 2) {
buf[i] = buf[i] ^ buf[i + 1];
buf[i + 1] = buf[i] ^ buf[i + 1];
buf[i] = buf[i] ^ buf[i + 1];
}
#elif LV_COLOR_DEPTH == 32 #if LV_COLOR_DEPTH == 32
if(b->bpp == 32) { if(b->bpp == 32) {
lv_coord_t i; lv_coord_t i;
for(i = 0; i < len; i++) { for(i = 0; i < len; i++) {

View File

@@ -22,11 +22,7 @@
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
#define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_RGB8 #define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_RGB8
#elif LV_COLOR_DEPTH == 16 #elif LV_COLOR_DEPTH == 16
#if LV_COLOR_16_SWAP == 0 #define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_RGB565LE
#define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_RGB565LE
#else
#define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_RGB565BE
#endif
#elif LV_COLOR_DEPTH == 32 #elif LV_COLOR_DEPTH == 32
#define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_BGR0 #define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_BGR0
#else #else

View File

@@ -14,6 +14,7 @@
#ifndef WIN32 #ifndef WIN32
#include <dirent.h> #include <dirent.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#else #else
#include <windows.h> #include <windows.h>
#endif #endif
@@ -117,7 +118,17 @@ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode)
char buf[MAX_PATH_LEN]; char buf[MAX_PATH_LEN];
lv_snprintf(buf, sizeof(buf), LV_FS_STDIO_PATH "%s", path); lv_snprintf(buf, sizeof(buf), LV_FS_STDIO_PATH "%s", path);
return fopen(buf, flags); void * a = fopen(buf, flags);
printf("%s\n", path);
printf("%d\n", errno);
char buf2[512];
getcwd(buf2, 512);
printf("%s\n", buf2);
printf("%p\n", a);
return a;
} }
/** /**

View File

@@ -207,12 +207,7 @@ static void convert_to_rgba5658(uint32_t * pix, const size_t width, const size_t
That's 3 mask, 3 bitshifts and 2 or operations */ That's 3 mask, 3 bitshifts and 2 or operations */
for(size_t x = 0; x < width; x++) { for(size_t x = 0; x < width; x++) {
uint32_t in = src[x]; uint32_t in = src[x];
#if LV_COLOR_16_SWAP == 0
uint16_t r = (uint16_t)(((in & 0xF80000) >> 8) | ((in & 0xFC00) >> 5) | ((in & 0xFF) >> 3)); uint16_t r = (uint16_t)(((in & 0xF80000) >> 8) | ((in & 0xFC00) >> 5) | ((in & 0xFF) >> 3));
#else
/* We want: rrrr rrrr GGGg gggg bbbb bbbb => gggb bbbb rrrr rGGG */
uint16_t r = (uint16_t)(((in & 0xF80000) >> 16) | ((in & 0xFC00) >> 13) | ((in & 0x1C00) << 3) | ((in & 0xF8) << 5));
#endif
lv_memcpy(dest, &r, sizeof(r)); lv_memcpy(dest, &r, sizeof(r));
dest[sizeof(r)] = (uint8_t)(in >> 24); dest[sizeof(r)] = (uint8_t)(in >> 24);

View File

@@ -767,7 +767,7 @@ static lv_res_t decoder_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc
uint16_t col_16bit = (*cache++ & 0xf8) << 8; uint16_t col_16bit = (*cache++ & 0xf8) << 8;
col_16bit |= (*cache++ & 0xFC) << 3; col_16bit |= (*cache++ & 0xFC) << 3;
col_16bit |= (*cache++ >> 3); col_16bit |= (*cache++ >> 3);
#if LV_BIG_ENDIAN_SYSTEM == 1 || LV_COLOR_16_SWAP == 1 #if LV_BIG_ENDIAN_SYSTEM == 1
buf[offset++] = col_16bit >> 8; buf[offset++] = col_16bit >> 8;
buf[offset++] = col_16bit & 0xff; buf[offset++] = col_16bit & 0xff;
#else #else
@@ -831,7 +831,7 @@ static lv_res_t decoder_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc
uint16_t col_8bit = (*cache++ & 0xf8) << 8; uint16_t col_8bit = (*cache++ & 0xf8) << 8;
col_8bit |= (*cache++ & 0xFC) << 3; col_8bit |= (*cache++ & 0xFC) << 3;
col_8bit |= (*cache++ >> 3); col_8bit |= (*cache++ >> 3);
#if LV_BIG_ENDIAN_SYSTEM == 1 || LV_COLOR_16_SWAP == 1 #if LV_BIG_ENDIAN_SYSTEM == 1
buf[offset++] = col_8bit >> 8; buf[offset++] = col_8bit >> 8;
buf[offset++] = col_8bit & 0xff; buf[offset++] = col_8bit & 0xff;
#else #else

View File

@@ -2337,14 +2337,10 @@
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */ /*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#ifndef LV_USE_DEMO_WIDGETS #ifndef LV_USE_DEMO_WIDGETS
#ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_DEMO_WIDGETS
#ifdef CONFIG_LV_USE_DEMO_WIDGETS #define LV_USE_DEMO_WIDGETS CONFIG_LV_USE_DEMO_WIDGETS
#define LV_USE_DEMO_WIDGETS CONFIG_LV_USE_DEMO_WIDGETS
#else
#define LV_USE_DEMO_WIDGETS 0
#endif
#else #else
#define LV_USE_DEMO_WIDGETS 1 #define LV_USE_DEMO_WIDGETS 0
#endif #endif
#endif #endif
#if LV_USE_DEMO_WIDGETS #if LV_USE_DEMO_WIDGETS

View File

@@ -23,17 +23,12 @@ extern "C" {
#error "LV_COLOR_DEPTH 24 is deprecated. Use LV_COLOR_DEPTH 32 instead (lv_conf.h)" #error "LV_COLOR_DEPTH 24 is deprecated. Use LV_COLOR_DEPTH 32 instead (lv_conf.h)"
#endif #endif
#if LV_COLOR_DEPTH != 16 && LV_COLOR_16_SWAP != 0
#error "LV_COLOR_16_SWAP requires LV_COLOR_DEPTH == 16. Set it in lv_conf.h"
#endif
#include <stdint.h> #include <stdint.h>
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
LV_EXPORT_CONST_INT(LV_COLOR_DEPTH); LV_EXPORT_CONST_INT(LV_COLOR_DEPTH);
LV_EXPORT_CONST_INT(LV_COLOR_16_SWAP);
/** /**
* Opacity percentages. * Opacity percentages.
@@ -128,30 +123,17 @@ enum {
# define LV_COLOR_MAKE8(r8, g8, b8) {{(uint8_t)((b8 >> 6) & 0x3U), (uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 5) & 0x7U)}} # define LV_COLOR_MAKE8(r8, g8, b8) {{(uint8_t)((b8 >> 6) & 0x3U), (uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 5) & 0x7U)}}
# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)((v) & 0x1FU) # define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)((v) & 0x1FU)
#if LV_COLOR_16_SWAP == 0
# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)((v) & 0x3FU) # define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)((v) & 0x3FU)
#else
# define LV_COLOR_SET_G16(c, v) {(c).ch.green_h = (uint8_t)(((v) >> 3) & 0x7); (c).ch.green_l = (uint8_t)((v) & 0x7);}
#endif
# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)((v) & 0x1FU) # define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)((v) & 0x1FU)
# define LV_COLOR_SET_A16(c, v) do {} while(0) # define LV_COLOR_SET_A16(c, v) do {} while(0)
# define LV_COLOR_GET_R16(c) (c).ch.red # define LV_COLOR_GET_R16(c) (c).ch.red
#if LV_COLOR_16_SWAP == 0
# define LV_COLOR_GET_G16(c) (c).ch.green # define LV_COLOR_GET_G16(c) (c).ch.green
#else
# define LV_COLOR_GET_G16(c) (((c).ch.green_h << 3) + (c).ch.green_l)
#endif
# define LV_COLOR_GET_B16(c) (c).ch.blue # define LV_COLOR_GET_B16(c) (c).ch.blue
# define LV_COLOR_GET_A16(c) 0xFF # define LV_COLOR_GET_A16(c) 0xFF
#if LV_COLOR_16_SWAP == 0
# define _LV_COLOR_ZERO_INITIALIZER16 {{0x00, 0x00, 0x00}} # define _LV_COLOR_ZERO_INITIALIZER16 {{0x00, 0x00, 0x00}}
# define LV_COLOR_MAKE16(r8, g8, b8) {{(uint8_t)((b8 >> 3) & 0x1FU), (uint8_t)((g8 >> 2) & 0x3FU), (uint8_t)((r8 >> 3) & 0x1FU)}} # define LV_COLOR_MAKE16(r8, g8, b8) {{(uint8_t)((b8 >> 3) & 0x1FU), (uint8_t)((g8 >> 2) & 0x3FU), (uint8_t)((r8 >> 3) & 0x1FU)}}
#else
# define _LV_COLOR_ZERO_INITIALIZER16 {{0x00, 0x00, 0x00, 0x00}}
# define LV_COLOR_MAKE16(r8, g8, b8) {{(uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 3) & 0x1FU), (uint8_t)((b8 >> 3) & 0x1FU), (uint8_t)((g8 >> 2) & 0x7U)}}
#endif
# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint8_t)((v) & 0xFF) # define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint8_t)((v) & 0xFF)
# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint8_t)((v) & 0xFF) # define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint8_t)((v) & 0xFF)
@@ -207,16 +189,9 @@ typedef union {
typedef union { typedef union {
struct { struct {
#if LV_COLOR_16_SWAP == 0
uint16_t blue : 5; uint16_t blue : 5;
uint16_t green : 6; uint16_t green : 6;
uint16_t red : 5; uint16_t red : 5;
#else
uint16_t green_h : 3;
uint16_t red : 5;
uint16_t blue : 5;
uint16_t green_l : 3;
#endif
} ch; } ch;
uint16_t full; uint16_t full;
} lv_color16_t; } lv_color16_t;
@@ -440,7 +415,7 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix(lv_color_t c1, lv_co
{ {
lv_color_t ret; lv_color_t ret;
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0 && LV_COLOR_MIX_ROUND_OFS == 0 #if LV_COLOR_DEPTH == 16 && LV_COLOR_MIX_ROUND_OFS == 0
/*Source: https://stackoverflow.com/a/50012418/1999969*/ /*Source: https://stackoverflow.com/a/50012418/1999969*/
mix = (uint32_t)((uint32_t)mix + 4) >> 3; mix = (uint32_t)((uint32_t)mix + 4) >> 3;
uint32_t bg = (uint32_t)((uint32_t)c2.full | ((uint32_t)c2.full << 16)) & uint32_t bg = (uint32_t)((uint32_t)c2.full | ((uint32_t)c2.full << 16)) &
@@ -594,7 +569,6 @@ static inline lv_color_t lv_color_hex(uint32_t c)
{ {
#if LV_COLOR_DEPTH == 16 #if LV_COLOR_DEPTH == 16
lv_color_t r; lv_color_t r;
#if LV_COLOR_16_SWAP == 0
/* Convert a 4 bytes per pixel in format ARGB32 to R5G6B5 format /* Convert a 4 bytes per pixel in format ARGB32 to R5G6B5 format
naive way (by calling lv_color_make with components): naive way (by calling lv_color_make with components):
r = ((c & 0xFF0000) >> 19) r = ((c & 0xFF0000) >> 19)
@@ -610,10 +584,6 @@ static inline lv_color_t lv_color_hex(uint32_t c)
rgb565 = r | g | b rgb565 = r | g | b
That's 3 mask, 3 bitshifts and 2 or operations */ That's 3 mask, 3 bitshifts and 2 or operations */
r.full = (uint16_t)(((c & 0xF80000) >> 8) | ((c & 0xFC00) >> 5) | ((c & 0xFF) >> 3)); r.full = (uint16_t)(((c & 0xF80000) >> 8) | ((c & 0xFC00) >> 5) | ((c & 0xFF) >> 3));
#else
/* We want: rrrr rrrr GGGg gggg bbbb bbbb => gggb bbbb rrrr rGGG */
r.full = (uint16_t)(((c & 0xF80000) >> 16) | ((c & 0xFC00) >> 13) | ((c & 0x1C00) << 3) | ((c & 0xF8) << 5));
#endif
return r; return r;
#elif LV_COLOR_DEPTH == 32 #elif LV_COLOR_DEPTH == 32
lv_color_t r; lv_color_t r;

View File

@@ -65,9 +65,9 @@ extern "C" {
#define LV_ROOTS LV_ITERATE_ROOTS(LV_DEFINE_ROOT) #define LV_ROOTS LV_ITERATE_ROOTS(LV_DEFINE_ROOT)
#if LV_ENABLE_GC == 1 #if LV_ENABLE_GC == 1
#if LV_MEM_CUSTOM != 1 #if LV_USE_BUILTIN_MALLOC
#error "GC requires CUSTOM_MEM" #error "GC requires CUSTOM_MEM"
#endif /*LV_MEM_CUSTOM*/ #endif /*LV_USE_BUILTIN_MALLOC*/
#include LV_GC_INCLUDE #include LV_GC_INCLUDE
#else /*LV_ENABLE_GC*/ #else /*LV_ENABLE_GC*/
#define LV_GC_ROOT(x) x #define LV_GC_ROOT(x) x

View File

@@ -93,16 +93,10 @@ void _lv_log_add(lv_log_level_t level, const char * file, int line, const char *
#else #else
if(custom_print_cb) { if(custom_print_cb) {
char buf[512]; char buf[512];
#if LV_SPRINTF_CUSTOM
char msg[256]; char msg[256];
lv_vsnprintf(msg, sizeof(msg), format, args); lv_vsnprintf(msg, sizeof(msg), format, args);
lv_snprintf(buf, sizeof(buf), "[%s]\t(%" LV_PRId32 ".%03" LV_PRId32 ", +%" LV_PRId32 ")\t %s: %s \t(in %s line #%d)\n", lv_snprintf(buf, sizeof(buf), "[%s]\t(%" LV_PRId32 ".%03" LV_PRId32 ", +%" LV_PRId32 ")\t %s: %s \t(in %s line #%d)\n",
lvl_prefix[level], t / 1000, t % 1000, t - last_log_time, func, msg, &file[p], line); lvl_prefix[level], t / 1000, t % 1000, t - last_log_time, func, msg, &file[p], line);
#else
lv_vaformat_t vaf = {format, &args};
lv_snprintf(buf, sizeof(buf), "[%s]\t(%" LV_PRId32 ".%03" LV_PRId32 ", +%" LV_PRId32 ")\t %s: %pV \t(in %s line #%d)\n",
lvl_prefix[level], t / 1000, t % 1000, t - last_log_time, func, (void *)&vaf, &file[p], line);
#endif
custom_print_cb(buf); custom_print_cb(buf);
} }
#endif #endif
@@ -124,12 +118,7 @@ void lv_log(const char * format, ...)
#else #else
if(custom_print_cb) { if(custom_print_cb) {
char buf[512]; char buf[512];
#if LV_SPRINTF_CUSTOM
lv_vsnprintf(buf, sizeof(buf), format, args); lv_vsnprintf(buf, sizeof(buf), format, args);
#else
lv_vaformat_t vaf = {format, &args};
lv_snprintf(buf, sizeof(buf), "%pV", (void *)&vaf);
#endif
custom_print_cb(buf); custom_print_cb(buf);
} }
#endif #endif

View File

@@ -135,7 +135,7 @@ void * lv_memcpy(void * dst, const void * src, size_t len)
void lv_memset(void * dst, uint8_t v, size_t len) void lv_memset(void * dst, uint8_t v, size_t len)
{ {
return LV_MEMSET(dst, v, len); LV_MEMSET(dst, v, len);
} }
size_t lv_strlen(const char * str) size_t lv_strlen(const char * str)

View File

@@ -84,7 +84,7 @@ static inline void lv_memzero(void * dst, size_t len)
lv_memset(dst, 0x00, len); lv_memset(dst, 0x00, len);
} }
size_t lv_strlenn(const char * str); size_t lv_strlen(const char * str);
size_t lv_strncpy(char * dst, size_t dest_size, const char * src); size_t lv_strncpy(char * dst, size_t dest_size, const char * src);

View File

@@ -7,6 +7,7 @@
*********************/ *********************/
#include "lv_mem.h" #include "lv_mem.h"
#if LV_USE_BUILTIN_MALLOC #if LV_USE_BUILTIN_MALLOC
#include "lv_mem_builtin.h"
#include "lv_tlsf.h" #include "lv_tlsf.h"
#include "lv_assert.h" #include "lv_assert.h"
#include "lv_log.h" #include "lv_log.h"

View File

@@ -60,7 +60,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_memset_builtin(void * dst, uint8_t v, size_t len);
size_t lv_strlen_builtin(const char * str); size_t lv_strlen_builtin(const char * str);
size_t lv_strncpy_builtin(char * dst, size_t dest_size, const char * src);; size_t lv_strncpy_builtin(char * dst, size_t dest_size, const char * src);
/** /**
* *

View File

@@ -33,9 +33,6 @@
/*Original repository: https://github.com/mpaland/printf*/ /*Original repository: https://github.com/mpaland/printf*/
#include "lv_printf.h" #include "lv_printf.h"
#if LV_SPRINTF_CUSTOM == 0
#include <stdbool.h> #include <stdbool.h>
#define PRINTF_DISABLE_SUPPORT_FLOAT (!LV_SPRINTF_USE_FLOAT) #define PRINTF_DISABLE_SUPPORT_FLOAT (!LV_SPRINTF_USE_FLOAT)
@@ -862,7 +859,7 @@ static int _vsnprintf(out_fct_type out, char * buffer, const size_t maxlen, cons
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
int lv_snprintf(char * buffer, size_t count, const char * format, ...) int lv_snprintf_builtin(char * buffer, size_t count, const char * format, ...)
{ {
va_list va; va_list va;
va_start(va, format); va_start(va, format);
@@ -871,9 +868,7 @@ int lv_snprintf(char * buffer, size_t count, const char * format, ...)
return ret; return ret;
} }
int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va) int lv_vsnprintf_builtin(char * buffer, size_t count, const char * format, va_list va)
{ {
return _vsnprintf(_out_buffer, buffer, count, format, va); return _vsnprintf(_out_buffer, buffer, count, format, va);
} }
#endif /*LV_SPRINTF_CUSTOM*/

View File

@@ -55,9 +55,6 @@ extern "C" {
#endif #endif
#include "../lv_conf_internal.h" #include "../lv_conf_internal.h"
#if LV_SPRINTF_CUSTOM == 0
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h> #include <stddef.h>
@@ -68,6 +65,9 @@ typedef struct {
va_list * va; va_list * va;
} lv_vaformat_t; } lv_vaformat_t;
int lv_snprintf_builtin(char * buffer, size_t count, const char * format, ...);
int lv_vsnprintf_builtin(char * buffer, size_t count, const char * format, va_list va);
/** /**
* Tiny snprintf/vsnprintf implementation * Tiny snprintf/vsnprintf implementation
* \param buffer A pointer to the buffer where to store the formatted string * \param buffer A pointer to the buffer where to store the formatted string
@@ -78,12 +78,29 @@ typedef struct {
* null character. A value equal or larger than count indicates truncation. Only when the returned value * null character. A value equal or larger than count indicates truncation. Only when the returned value
* is non-negative and less than count, the string has been completely written. * is non-negative and less than count, the string has been completely written.
*/ */
int lv_snprintf(char * buffer, size_t count, const char * format, ...) LV_FORMAT_ATTRIBUTE(3, 4); LV_FORMAT_ATTRIBUTE(3, 4) static inline int lv_snprintf(char * buffer, size_t count, const char * format, ...)
int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va) LV_FORMAT_ATTRIBUTE(3, 0); {
/* Declare a va_list type variable */
va_list args;
/* Initialise the va_list variable with the ... after fmt */
va_start(args, format);
/* Forward the '...' to vprintf */
int ret = LV_SNPRINTF(buffer, count, format, args);
/* Clean up the va_list */
va_end(args);
return ret;
}
LV_FORMAT_ATTRIBUTE(3, 0) static inline int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va)
{
return LV_VSNPRINTF(buffer, count, format, va);
}
#else
#include LV_SPRINTF_INCLUDE
#endif
#ifdef __cplusplus #ifdef __cplusplus
} /*extern "C"*/ } /*extern "C"*/

View File

@@ -1,5 +1,5 @@
#include "../lv_conf_internal.h" #include "../lv_conf_internal.h"
#if LV_MEM_CUSTOM == 0 #if LV_USE_BUILTIN_MALLOC
#include <limits.h> #include <limits.h>
#include "lv_tlsf.h" #include "lv_tlsf.h"
@@ -1243,4 +1243,4 @@ void * lv_tlsf_realloc(lv_tlsf_t tlsf, void * ptr, size_t size)
return p; return p;
} }
#endif /* LV_MEM_CUSTOM == 0 */ #endif /* LV_USE_BUILTIN_MALLOC */

View File

@@ -1,5 +1,5 @@
#include "../lv_conf_internal.h" #include "../lv_conf_internal.h"
#if LV_MEM_CUSTOM == 0 #if LV_USE_BUILTIN_MALLOC
#ifndef LV_TLSF_H #ifndef LV_TLSF_H
#define LV_TLSF_H #define LV_TLSF_H
@@ -92,4 +92,4 @@ int lv_tlsf_check_pool(lv_pool_t pool);
#endif /*LV_TLSF_H*/ #endif /*LV_TLSF_H*/
#endif /* LV_MEM_CUSTOM == 0 */ #endif /* LV_USE_BUILTIN_MALLOC */

View File

@@ -289,11 +289,7 @@ void lv_canvas_blur_hor(lv_obj_t * obj, const lv_area_t * area, uint16_t r)
if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, x_safe, 0); if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, x_safe, 0);
rsum += c.ch.red; rsum += c.ch.red;
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP
gsum += (c.ch.green_h << 3) + c.ch.green_l;
#else
gsum += c.ch.green; gsum += c.ch.green;
#endif
bsum += c.ch.blue; bsum += c.ch.blue;
if(has_alpha) asum += opa; if(has_alpha) asum += opa;
} }
@@ -305,13 +301,7 @@ void lv_canvas_blur_hor(lv_obj_t * obj, const lv_area_t * area, uint16_t r)
if(asum) { if(asum) {
c.ch.red = rsum / r; c.ch.red = rsum / r;
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP
uint8_t gtmp = gsum / r;
c.ch.green_h = gtmp >> 3;
c.ch.green_l = gtmp & 0x7;
#else
c.ch.green = gsum / r; c.ch.green = gsum / r;
#endif
c.ch.blue = bsum / r; c.ch.blue = bsum / r;
if(has_alpha) opa = asum / r; if(has_alpha) opa = asum / r;
@@ -325,11 +315,7 @@ void lv_canvas_blur_hor(lv_obj_t * obj, const lv_area_t * area, uint16_t r)
if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, x_safe, 0); if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, x_safe, 0);
rsum -= c.ch.red; rsum -= c.ch.red;
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP
gsum -= (c.ch.green_h << 3) + c.ch.green_l;
#else
gsum -= c.ch.green; gsum -= c.ch.green;
#endif
bsum -= c.ch.blue; bsum -= c.ch.blue;
if(has_alpha) asum -= opa; if(has_alpha) asum -= opa;
@@ -339,11 +325,7 @@ void lv_canvas_blur_hor(lv_obj_t * obj, const lv_area_t * area, uint16_t r)
if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, x_safe, 0); if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, x_safe, 0);
rsum += c.ch.red; rsum += c.ch.red;
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP
gsum += (c.ch.green_h << 3) + c.ch.green_l;
#else
gsum += c.ch.green; gsum += c.ch.green;
#endif
bsum += c.ch.blue; bsum += c.ch.blue;
if(has_alpha) asum += opa; if(has_alpha) asum += opa;
} }
@@ -418,11 +400,7 @@ void lv_canvas_blur_ver(lv_obj_t * obj, const lv_area_t * area, uint16_t r)
if(has_alpha) lv_img_buf_set_px_alpha(&line_img, 0, y_safe, opa); if(has_alpha) lv_img_buf_set_px_alpha(&line_img, 0, y_safe, opa);
rsum += c.ch.red; rsum += c.ch.red;
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP
gsum += (c.ch.green_h << 3) + c.ch.green_l;
#else
gsum += c.ch.green; gsum += c.ch.green;
#endif
bsum += c.ch.blue; bsum += c.ch.blue;
if(has_alpha) asum += opa; if(has_alpha) asum += opa;
} }
@@ -433,13 +411,7 @@ void lv_canvas_blur_ver(lv_obj_t * obj, const lv_area_t * area, uint16_t r)
for(y = a.y1; y <= a.y2; y++) { for(y = a.y1; y <= a.y2; y++) {
if(asum) { if(asum) {
c.ch.red = rsum / r; c.ch.red = rsum / r;
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP
uint8_t gtmp = gsum / r;
c.ch.green_h = gtmp >> 3;
c.ch.green_l = gtmp & 0x7;
#else
c.ch.green = gsum / r; c.ch.green = gsum / r;
#endif
c.ch.blue = bsum / r; c.ch.blue = bsum / r;
if(has_alpha) opa = asum / r; if(has_alpha) opa = asum / r;
@@ -453,11 +425,7 @@ void lv_canvas_blur_ver(lv_obj_t * obj, const lv_area_t * area, uint16_t r)
if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, 0, y_safe); if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, 0, y_safe);
rsum -= c.ch.red; rsum -= c.ch.red;
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP
gsum -= (c.ch.green_h << 3) + c.ch.green_l;
#else
gsum -= c.ch.green; gsum -= c.ch.green;
#endif
bsum -= c.ch.blue; bsum -= c.ch.blue;
if(has_alpha) asum -= opa; if(has_alpha) asum -= opa;
@@ -471,11 +439,7 @@ void lv_canvas_blur_ver(lv_obj_t * obj, const lv_area_t * area, uint16_t r)
if(has_alpha) lv_img_buf_set_px_alpha(&line_img, 0, y_safe, opa); if(has_alpha) lv_img_buf_set_px_alpha(&line_img, 0, y_safe, opa);
rsum += c.ch.red; rsum += c.ch.red;
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP
gsum += (c.ch.green_h << 3) + c.ch.green_l;
#else
gsum += c.ch.green; gsum += c.ch.green;
#endif
bsum += c.ch.blue; bsum += c.ch.blue;
if(has_alpha) asum += opa; if(has_alpha) asum += opa;
} }

View File

@@ -23,7 +23,7 @@ set(LVGL_TEST_OPTIONS_MINIMAL_MONOCHROME
-DLV_COLOR_DEPTH=1 -DLV_COLOR_DEPTH=1
-DLV_MEM_SIZE=65535 -DLV_MEM_SIZE=65535
-DLV_DPI_DEF=40 -DLV_DPI_DEF=40
-DLV_DRAW_COMPLEX=0 -DLV_USE_DRAW_MASKS=0
-DLV_USE_METER=0 -DLV_USE_METER=0
-DLV_USE_LOG=1 -DLV_USE_LOG=1
-DLV_USE_ASSERT_NULL=0 -DLV_USE_ASSERT_NULL=0
@@ -47,7 +47,7 @@ set(LVGL_TEST_OPTIONS_NORMAL_8BIT
-DLV_COLOR_DEPTH=8 -DLV_COLOR_DEPTH=8
-DLV_MEM_SIZE=65535 -DLV_MEM_SIZE=65535
-DLV_DPI_DEF=40 -DLV_DPI_DEF=40
-DLV_DRAW_COMPLEX=1 -DLV_USE_DRAW_MASKS=1
-DLV_USE_LOG=1 -DLV_USE_LOG=1
-DLV_USE_ASSERT_NULL=0 -DLV_USE_ASSERT_NULL=0
-DLV_USE_ASSERT_MALLOC=0 -DLV_USE_ASSERT_MALLOC=0
@@ -73,7 +73,7 @@ set(LVGL_TEST_OPTIONS_16BIT
-DLV_COLOR_16_SWAP=0 -DLV_COLOR_16_SWAP=0
-DLV_MEM_SIZE=65536 -DLV_MEM_SIZE=65536
-DLV_DPI_DEF=40 -DLV_DPI_DEF=40
-DLV_DRAW_COMPLEX=1 -DLV_USE_DRAW_MASKS=1
-DLV_DITHER_GRADIENT=1 -DLV_DITHER_GRADIENT=1
-DLV_USE_LOG=1 -DLV_USE_LOG=1
-DLV_USE_ASSERT_NULL=0 -DLV_USE_ASSERT_NULL=0
@@ -100,7 +100,7 @@ set(LVGL_TEST_OPTIONS_16BIT_SWAP
-DLV_COLOR_16_SWAP=1 -DLV_COLOR_16_SWAP=1
-DLV_MEM_SIZE=65536 -DLV_MEM_SIZE=65536
-DLV_DPI_DEF=40 -DLV_DPI_DEF=40
-DLV_DRAW_COMPLEX=1 -DLV_USE_DRAW_MASKS=1
-DLV_DITHER_GRADIENT=1 -DLV_DITHER_GRADIENT=1
-DLV_DITHER_ERROR_DIFFUSION=1 -DLV_DITHER_ERROR_DIFFUSION=1
-DLV_GRAD_CACHE_DEF_SIZE=8*1024 -DLV_GRAD_CACHE_DEF_SIZE=8*1024
@@ -128,7 +128,7 @@ set(LVGL_TEST_OPTIONS_FULL_32BIT
-DLV_COLOR_DEPTH=32 -DLV_COLOR_DEPTH=32
-DLV_MEM_SIZE=8388608 -DLV_MEM_SIZE=8388608
-DLV_DPI_DEF=160 -DLV_DPI_DEF=160
-DLV_DRAW_COMPLEX=1 -DLV_USE_DRAW_MASKS=1
-DLV_SHADOW_CACHE_SIZE=1 -DLV_SHADOW_CACHE_SIZE=1
-DLV_IMG_CACHE_DEF_SIZE=32 -DLV_IMG_CACHE_DEF_SIZE=32
-DLV_USE_LOG=1 -DLV_USE_LOG=1

View File

@@ -2,6 +2,7 @@
#if LV_BUILD_TEST #if LV_BUILD_TEST
#include "lv_test_init.h" #include "lv_test_init.h"
#include "lv_test_indev.h" #include "lv_test_indev.h"
#include "../../src/misc/lv_mem_builtin.h"
#include <sys/time.h> #include <sys/time.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -28,7 +29,7 @@ void lv_test_init(void)
void lv_test_deinit(void) void lv_test_deinit(void)
{ {
lv_mem_deinit(); lv_mem_deinit_builtin();
} }
static void hal_init(void) static void hal_init(void)

View File

@@ -23,7 +23,7 @@ void test_read(void)
/*'A' has cache*/ /*'A' has cache*/
lv_fs_file_t fa; lv_fs_file_t fa;
res = lv_fs_open(&fa, "A:src/test_files/readtest.txt", LV_FS_MODE_RD); res = lv_fs_open(&fa, "A:readtest.txt", LV_FS_MODE_RD);
TEST_ASSERT_EQUAL(LV_FS_RES_OK, res); TEST_ASSERT_EQUAL(LV_FS_RES_OK, res);
/*'B' has no cache*/ /*'B' has no cache*/

View File

@@ -16,7 +16,7 @@ void tearDown(void)
/* #3324 */ /* #3324 */
void test_mem_buf_realloc(void) void test_mem_buf_realloc(void)
{ {
#if LV_MEM_CUSTOM == 0 #if LV_USE_BUILTIN_MALLOC
void * buf1 = lv_malloc(20); void * buf1 = lv_malloc(20);
void * buf2 = lv_realloc(buf1, LV_MEM_SIZE + 16384); void * buf2 = lv_realloc(buf1, LV_MEM_SIZE + 16384);
TEST_ASSERT_NULL(buf2); TEST_ASSERT_NULL(buf2);