1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

add GC to lv_conf_templ.h

This commit is contained in:
Gabor Kiss-Vamosi 2019-01-28 16:01:59 +01:00
parent 08007aa4d5
commit 9185e1c4a6
2 changed files with 104 additions and 80 deletions

View File

@ -16,30 +16,46 @@
#define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/
#endif
#if LV_MEM_CUSTOM == 0
#ifndef LV_MEM_SIZE
#define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
#ifndef define
# define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
#endif
#ifndef LV_MEM_ATTR
#define LV_MEM_ATTR /*Complier prefix for big array declaration*/
#ifndef define
# define LV_MEM_ATTR /*Complier prefix for big array declaration*/
#endif
#ifndef LV_MEM_ADR
#define LV_MEM_ADR 0 /*Set an address for memory pool instead of allocation it as an array. Can be in external SRAM too.*/
#ifndef define
# define LV_MEM_ADR 0 /*Set an address for memory pool instead of allocation it as an array. Can be in external SRAM too.*/
#endif
#ifndef LV_MEM_AUTO_DEFRAG
#define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
#ifndef define
# define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
#endif
#else /*LV_MEM_CUSTOM*/
#ifndef LV_MEM_CUSTOM_INCLUDE
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
#ifndef define
# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
#endif
#ifndef LV_MEM_CUSTOM_ALLOC
#define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
#ifndef define
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
#endif
#ifndef LV_MEM_CUSTOM_FREE
#define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#ifndef define
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#endif
#endif /*LV_MEM_CUSTOM*/
/* Garbage Collector settings. */
#ifndef LV_ENABLE_GC
#define LV_ENABLE_GC 0
#endif
#if LV_ENABLE_GC != 0
#ifndef define
# define LV_MEM_CUSTOM_REALLOC your_realloc /*Wrapper to realloc*/
#endif
#ifndef define
# define LV_MEM_CUSTOM_GET_SIZE your_mem_get_size /*Wrapper to lv_mem_get_size*/
#endif
#ifndef define
# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
#endif
#endif /* LV_ENABLE_GC */
/*===================
Graphical settings
*===================*/
@ -240,13 +256,13 @@
* 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
*/
#ifndef LV_LOG_LEVEL
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
#ifndef define
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
#endif
/* 1: Print the log with 'printf'; 0: user need to register a callback*/
#ifndef LV_LOG_PRINTF
#define LV_LOG_PRINTF 1
#ifndef define
# define LV_LOG_PRINTF 1
#endif
#endif /*USE_LV_LOG*/
@ -389,8 +405,8 @@
#define USE_LV_LABEL 1
#endif
#if USE_LV_LABEL != 0
#ifndef LV_LABEL_SCROLL_SPEED
#define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
#ifndef define
# define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
#endif
#endif
@ -399,11 +415,11 @@
#define USE_LV_IMG 1
#endif
#if USE_LV_IMG != 0
#ifndef LV_IMG_CF_INDEXED
#define LV_IMG_CF_INDEXED 1 /*Enable indexed (palette) images*/
#ifndef define
# define LV_IMG_CF_INDEXED 1 /*Enable indexed (palette) images*/
#endif
#ifndef LV_IMG_CF_ALPHA
#define LV_IMG_CF_ALPHA 1 /*Enable alpha indexed images*/
#ifndef define
# define LV_IMG_CF_ALPHA 1 /*Enable alpha indexed images*/
#endif
#endif
@ -440,9 +456,9 @@
#ifndef USE_LV_TABVIEW
#define USE_LV_TABVIEW 1
#endif
#if USE_LV_TABVIEW != 0
#ifndef LV_TABVIEW_ANIM_TIME
#define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
# if USE_LV_TABVIEW != 0
#ifndef define
# define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
#endif
#endif
@ -451,8 +467,8 @@
#define USE_LV_TILEVIEW 1
#endif
#if USE_LV_TILEVIEW
#ifndef LV_TILEVIEW_ANIM_TIME
#define LV_TILEVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
#ifndef define
# define LV_TILEVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
#endif
#endif
@ -485,8 +501,8 @@
#define USE_LV_TABLE 1
#endif
#if USE_LV_TABLE
#ifndef LV_TABLE_COL_MAX
#define LV_TABLE_COL_MAX 12
#ifndef define
# define LV_TABLE_COL_MAX 12
#endif
#endif
@ -505,11 +521,11 @@
#define USE_LV_TA 1
#endif
#if USE_LV_TA != 0
#ifndef LV_TA_CURSOR_BLINK_TIME
#define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
#ifndef define
# define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
#endif
#ifndef LV_TA_PWD_SHOW_TIME
#define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
#ifndef define
# define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
#endif
#endif
@ -528,14 +544,14 @@
#define USE_LV_PRELOAD 1
#endif
#if USE_LV_PRELOAD != 0
#ifndef LV_PRELOAD_DEF_ARC_LENGTH
#define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/
#ifndef define
# define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/
#endif
#ifndef LV_PRELOAD_DEF_SPIN_TIME
#define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/
#ifndef define
# define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/
#endif
#ifndef LV_PRELOAD_DEF_ANIM
#define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
#ifndef define
# define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
#endif
#endif
@ -552,8 +568,8 @@
#define USE_LV_BTN 1
#endif
#if USE_LV_BTN != 0
#ifndef LV_BTN_INK_EFFECT
#define LV_BTN_INK_EFFECT 1 /*Enable button-state animations - draw a circle on click (dependencies: USE_LV_ANIMATION)*/
#ifndef define
# define LV_BTN_INK_EFFECT 1 /*Enable button-state animations - draw a circle on click (dependencies: USE_LV_ANIMATION)*/
#endif
#endif
@ -562,8 +578,8 @@
#define USE_LV_IMGBTN 1
#endif
#if USE_LV_IMGBTN
#ifndef LV_IMGBTN_TILED
#define LV_IMGBTN_TILED 0 /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
#ifndef define
# define LV_IMGBTN_TILED 0 /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
#endif
#endif
@ -587,8 +603,8 @@
#define USE_LV_LIST 1
#endif
#if USE_LV_LIST != 0
#ifndef LV_LIST_FOCUS_TIME
#define LV_LIST_FOCUS_TIME 100 /*Default animation time of focusing to a list element [ms] (0: no animation) */
#ifndef define
# define LV_LIST_FOCUS_TIME 100 /*Default animation time of focusing to a list element [ms] (0: no animation) */
#endif
#endif
@ -597,8 +613,8 @@
#define USE_LV_DDLIST 1
#endif
#if USE_LV_DDLIST != 0
#ifndef LV_DDLIST_ANIM_TIME
#define LV_DDLIST_ANIM_TIME 200 /*Open and close default animation time [ms] (0: no animation)*/
#ifndef define
# define LV_DDLIST_ANIM_TIME 200 /*Open and close default animation time [ms] (0: no animation)*/
#endif
#endif
@ -607,8 +623,8 @@
#define USE_LV_ROLLER 1
#endif
#if USE_LV_ROLLER != 0
#ifndef LV_ROLLER_ANIM_TIME
#define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/
#ifndef define
# define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/
#endif
#endif
@ -626,8 +642,8 @@
* Non-user section
*************************/
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#ifndef define
# define _CRT_SECURE_NO_WARNINGS
#endif
#endif

View File

@ -19,16 +19,24 @@
* to store the graphical objects and other data */
#define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/
#if LV_MEM_CUSTOM == 0
#define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
#define LV_MEM_ATTR /*Complier prefix for big array declaration*/
#define LV_MEM_ADR 0 /*Set an address for memory pool instead of allocation it as an array. Can be in external SRAM too.*/
#define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
# define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
# define LV_MEM_ATTR /*Complier prefix for big array declaration*/
# define LV_MEM_ADR 0 /*Set an address for memory pool instead of allocation it as an array. Can be in external SRAM too.*/
# define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
#else /*LV_MEM_CUSTOM*/
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
#define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
#define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#endif /*LV_MEM_CUSTOM*/
/* Garbage Collector settings. */
#define LV_ENABLE_GC 0
#if LV_ENABLE_GC != 0
# define LV_MEM_CUSTOM_REALLOC your_realloc /*Wrapper to realloc*/
# define LV_MEM_CUSTOM_GET_SIZE your_mem_get_size /*Wrapper to lv_mem_get_size*/
# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
#endif /* LV_ENABLE_GC */
/*===================
Graphical settings
*===================*/
@ -147,10 +155,10 @@
* 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
*/
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
/* 1: Print the log with 'printf'; 0: user need to register a callback*/
#define LV_LOG_PRINTF 1
# define LV_LOG_PRINTF 1
#endif /*USE_LV_LOG*/
/*================
@ -228,14 +236,14 @@
/*Label (dependencies: -*/
#define USE_LV_LABEL 1
#if USE_LV_LABEL != 0
#define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
# define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
#endif
/*Image (dependencies: lv_label*/
#define USE_LV_IMG 1
#if USE_LV_IMG != 0
#define LV_IMG_CF_INDEXED 1 /*Enable indexed (palette) images*/
#define LV_IMG_CF_ALPHA 1 /*Enable alpha indexed images*/
# define LV_IMG_CF_INDEXED 1 /*Enable indexed (palette) images*/
# define LV_IMG_CF_ALPHA 1 /*Enable alpha indexed images*/
#endif
/*Line (dependencies: -*/
@ -259,14 +267,14 @@
/*Tab (dependencies: lv_page, lv_btnm)*/
#define USE_LV_TABVIEW 1
#if USE_LV_TABVIEW != 0
#define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
# if USE_LV_TABVIEW != 0
# define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
#endif
/*Tileview (dependencies: lv_page) */
#define USE_LV_TILEVIEW 1
#if USE_LV_TILEVIEW
#define LV_TILEVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
# define LV_TILEVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
#endif
/*************************
@ -288,7 +296,7 @@
/*Table (dependencies: lv_label)*/
#define USE_LV_TABLE 1
#if USE_LV_TABLE
#define LV_TABLE_COL_MAX 12
# define LV_TABLE_COL_MAX 12
#endif
/*LED (dependencies: -)*/
@ -300,8 +308,8 @@
/*Text area (dependencies: lv_label, lv_page)*/
#define USE_LV_TA 1
#if USE_LV_TA != 0
#define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
#define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
# define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
# define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
#endif
/*Spinbox (dependencies: lv_ta)*/
@ -313,9 +321,9 @@
/*Preload (dependencies: lv_arc)*/
#define USE_LV_PRELOAD 1
#if USE_LV_PRELOAD != 0
#define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/
#define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/
#define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
# define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/
# define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/
# define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
#endif
/*Canvas (dependencies: lv_img)*/
@ -327,13 +335,13 @@
/*Button (dependencies: lv_cont*/
#define USE_LV_BTN 1
#if USE_LV_BTN != 0
#define LV_BTN_INK_EFFECT 1 /*Enable button-state animations - draw a circle on click (dependencies: USE_LV_ANIMATION)*/
# define LV_BTN_INK_EFFECT 1 /*Enable button-state animations - draw a circle on click (dependencies: USE_LV_ANIMATION)*/
#endif
/*Image Button (dependencies: lv_btn*/
#define USE_LV_IMGBTN 1
#if USE_LV_IMGBTN
#define LV_IMGBTN_TILED 0 /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
# define LV_IMGBTN_TILED 0 /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
#endif
/*Button matrix (dependencies: -)*/
@ -348,19 +356,19 @@
/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
#define USE_LV_LIST 1
#if USE_LV_LIST != 0
#define LV_LIST_FOCUS_TIME 100 /*Default animation time of focusing to a list element [ms] (0: no animation) */
# define LV_LIST_FOCUS_TIME 100 /*Default animation time of focusing to a list element [ms] (0: no animation) */
#endif
/*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
#define USE_LV_DDLIST 1
#if USE_LV_DDLIST != 0
#define LV_DDLIST_ANIM_TIME 200 /*Open and close default animation time [ms] (0: no animation)*/
# define LV_DDLIST_ANIM_TIME 200 /*Open and close default animation time [ms] (0: no animation)*/
#endif
/*Roller (dependencies: lv_ddlist)*/
#define USE_LV_ROLLER 1
#if USE_LV_ROLLER != 0
#define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/
# define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/
#endif
/*Slider (dependencies: lv_bar)*/
@ -373,7 +381,7 @@
* Non-user section
*************************/
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
#define _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
#endif
/*--END OF LV_CONF_H--*/