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*/ #define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/
#endif #endif
#if LV_MEM_CUSTOM == 0 #if LV_MEM_CUSTOM == 0
#ifndef LV_MEM_SIZE #ifndef define
#define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/ # define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
#endif #endif
#ifndef LV_MEM_ATTR #ifndef define
#define LV_MEM_ATTR /*Complier prefix for big array declaration*/ # define LV_MEM_ATTR /*Complier prefix for big array declaration*/
#endif #endif
#ifndef LV_MEM_ADR #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.*/ # 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 #endif
#ifndef LV_MEM_AUTO_DEFRAG #ifndef define
#define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/ # define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
#endif #endif
#else /*LV_MEM_CUSTOM*/ #else /*LV_MEM_CUSTOM*/
#ifndef LV_MEM_CUSTOM_INCLUDE #ifndef define
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/ # define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
#endif #endif
#ifndef LV_MEM_CUSTOM_ALLOC #ifndef define
#define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/ # define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
#endif #endif
#ifndef LV_MEM_CUSTOM_FREE #ifndef define
#define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/ # define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#endif #endif
#endif /*LV_MEM_CUSTOM*/ #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 Graphical settings
*===================*/ *===================*/
@ -240,13 +256,13 @@
* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't caused problem * 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_ERROR Only critical issue, when the system may fail
*/ */
#ifndef LV_LOG_LEVEL #ifndef define
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN # define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
#endif #endif
/* 1: Print the log with 'printf'; 0: user need to register a callback*/ /* 1: Print the log with 'printf'; 0: user need to register a callback*/
#ifndef LV_LOG_PRINTF #ifndef define
#define LV_LOG_PRINTF 1 # define LV_LOG_PRINTF 1
#endif #endif
#endif /*USE_LV_LOG*/ #endif /*USE_LV_LOG*/
@ -389,8 +405,8 @@
#define USE_LV_LABEL 1 #define USE_LV_LABEL 1
#endif #endif
#if USE_LV_LABEL != 0 #if USE_LV_LABEL != 0
#ifndef LV_LABEL_SCROLL_SPEED #ifndef define
#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 #endif
#endif #endif
@ -399,11 +415,11 @@
#define USE_LV_IMG 1 #define USE_LV_IMG 1
#endif #endif
#if USE_LV_IMG != 0 #if USE_LV_IMG != 0
#ifndef LV_IMG_CF_INDEXED #ifndef define
#define LV_IMG_CF_INDEXED 1 /*Enable indexed (palette) images*/ # define LV_IMG_CF_INDEXED 1 /*Enable indexed (palette) images*/
#endif #endif
#ifndef LV_IMG_CF_ALPHA #ifndef define
#define LV_IMG_CF_ALPHA 1 /*Enable alpha indexed images*/ # define LV_IMG_CF_ALPHA 1 /*Enable alpha indexed images*/
#endif #endif
#endif #endif
@ -440,9 +456,9 @@
#ifndef USE_LV_TABVIEW #ifndef USE_LV_TABVIEW
#define USE_LV_TABVIEW 1 #define USE_LV_TABVIEW 1
#endif #endif
#if USE_LV_TABVIEW != 0 # if USE_LV_TABVIEW != 0
#ifndef LV_TABVIEW_ANIM_TIME #ifndef define
#define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/ # define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
#endif #endif
#endif #endif
@ -451,8 +467,8 @@
#define USE_LV_TILEVIEW 1 #define USE_LV_TILEVIEW 1
#endif #endif
#if USE_LV_TILEVIEW #if USE_LV_TILEVIEW
#ifndef LV_TILEVIEW_ANIM_TIME #ifndef define
#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 #endif
#endif #endif
@ -485,8 +501,8 @@
#define USE_LV_TABLE 1 #define USE_LV_TABLE 1
#endif #endif
#if USE_LV_TABLE #if USE_LV_TABLE
#ifndef LV_TABLE_COL_MAX #ifndef define
#define LV_TABLE_COL_MAX 12 # define LV_TABLE_COL_MAX 12
#endif #endif
#endif #endif
@ -505,11 +521,11 @@
#define USE_LV_TA 1 #define USE_LV_TA 1
#endif #endif
#if USE_LV_TA != 0 #if USE_LV_TA != 0
#ifndef LV_TA_CURSOR_BLINK_TIME #ifndef define
#define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/ # define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
#endif #endif
#ifndef LV_TA_PWD_SHOW_TIME #ifndef define
#define LV_TA_PWD_SHOW_TIME 1500 /*ms*/ # define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
#endif #endif
#endif #endif
@ -528,14 +544,14 @@
#define USE_LV_PRELOAD 1 #define USE_LV_PRELOAD 1
#endif #endif
#if USE_LV_PRELOAD != 0 #if USE_LV_PRELOAD != 0
#ifndef LV_PRELOAD_DEF_ARC_LENGTH #ifndef define
#define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/ # define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/
#endif #endif
#ifndef LV_PRELOAD_DEF_SPIN_TIME #ifndef define
#define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/ # define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/
#endif #endif
#ifndef LV_PRELOAD_DEF_ANIM #ifndef define
#define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC # define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
#endif #endif
#endif #endif
@ -552,8 +568,8 @@
#define USE_LV_BTN 1 #define USE_LV_BTN 1
#endif #endif
#if USE_LV_BTN != 0 #if USE_LV_BTN != 0
#ifndef LV_BTN_INK_EFFECT #ifndef define
#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 #endif
#endif #endif
@ -562,8 +578,8 @@
#define USE_LV_IMGBTN 1 #define USE_LV_IMGBTN 1
#endif #endif
#if USE_LV_IMGBTN #if USE_LV_IMGBTN
#ifndef LV_IMGBTN_TILED #ifndef define
#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 #endif
#endif #endif
@ -587,8 +603,8 @@
#define USE_LV_LIST 1 #define USE_LV_LIST 1
#endif #endif
#if USE_LV_LIST != 0 #if USE_LV_LIST != 0
#ifndef LV_LIST_FOCUS_TIME #ifndef define
#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 #endif
#endif #endif
@ -597,8 +613,8 @@
#define USE_LV_DDLIST 1 #define USE_LV_DDLIST 1
#endif #endif
#if USE_LV_DDLIST != 0 #if USE_LV_DDLIST != 0
#ifndef LV_DDLIST_ANIM_TIME #ifndef define
#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 #endif
#endif #endif
@ -607,8 +623,8 @@
#define USE_LV_ROLLER 1 #define USE_LV_ROLLER 1
#endif #endif
#if USE_LV_ROLLER != 0 #if USE_LV_ROLLER != 0
#ifndef LV_ROLLER_ANIM_TIME #ifndef define
#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 #endif
#endif #endif
@ -626,8 +642,8 @@
* Non-user section * Non-user section
*************************/ *************************/
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
#ifndef _CRT_SECURE_NO_WARNINGS #ifndef define
#define _CRT_SECURE_NO_WARNINGS # define _CRT_SECURE_NO_WARNINGS
#endif #endif
#endif #endif

View File

@ -19,16 +19,24 @@
* to store the graphical objects and other data */ * 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*/ #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 #if LV_MEM_CUSTOM == 0
#define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/ # 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_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_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_AUTO_DEFRAG 1 /*Automatically defrag on free*/
#else /*LV_MEM_CUSTOM*/ #else /*LV_MEM_CUSTOM*/
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/ # 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_ALLOC malloc /*Wrapper to malloc*/
#define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/ # define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#endif /*LV_MEM_CUSTOM*/ #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 Graphical settings
*===================*/ *===================*/
@ -147,10 +155,10 @@
* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't caused problem * 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_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*/ /* 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*/ #endif /*USE_LV_LOG*/
/*================ /*================
@ -228,14 +236,14 @@
/*Label (dependencies: -*/ /*Label (dependencies: -*/
#define USE_LV_LABEL 1 #define USE_LV_LABEL 1
#if USE_LV_LABEL != 0 #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 #endif
/*Image (dependencies: lv_label*/ /*Image (dependencies: lv_label*/
#define USE_LV_IMG 1 #define USE_LV_IMG 1
#if USE_LV_IMG != 0 #if USE_LV_IMG != 0
#define LV_IMG_CF_INDEXED 1 /*Enable indexed (palette) images*/ # define LV_IMG_CF_INDEXED 1 /*Enable indexed (palette) images*/
#define LV_IMG_CF_ALPHA 1 /*Enable alpha indexed images*/ # define LV_IMG_CF_ALPHA 1 /*Enable alpha indexed images*/
#endif #endif
/*Line (dependencies: -*/ /*Line (dependencies: -*/
@ -259,14 +267,14 @@
/*Tab (dependencies: lv_page, lv_btnm)*/ /*Tab (dependencies: lv_page, lv_btnm)*/
#define USE_LV_TABVIEW 1 #define USE_LV_TABVIEW 1
#if USE_LV_TABVIEW != 0 # if USE_LV_TABVIEW != 0
#define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/ # define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
#endif #endif
/*Tileview (dependencies: lv_page) */ /*Tileview (dependencies: lv_page) */
#define USE_LV_TILEVIEW 1 #define USE_LV_TILEVIEW 1
#if USE_LV_TILEVIEW #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 #endif
/************************* /*************************
@ -288,7 +296,7 @@
/*Table (dependencies: lv_label)*/ /*Table (dependencies: lv_label)*/
#define USE_LV_TABLE 1 #define USE_LV_TABLE 1
#if USE_LV_TABLE #if USE_LV_TABLE
#define LV_TABLE_COL_MAX 12 # define LV_TABLE_COL_MAX 12
#endif #endif
/*LED (dependencies: -)*/ /*LED (dependencies: -)*/
@ -300,8 +308,8 @@
/*Text area (dependencies: lv_label, lv_page)*/ /*Text area (dependencies: lv_label, lv_page)*/
#define USE_LV_TA 1 #define USE_LV_TA 1
#if USE_LV_TA != 0 #if USE_LV_TA != 0
#define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/ # define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
#define LV_TA_PWD_SHOW_TIME 1500 /*ms*/ # define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
#endif #endif
/*Spinbox (dependencies: lv_ta)*/ /*Spinbox (dependencies: lv_ta)*/
@ -313,9 +321,9 @@
/*Preload (dependencies: lv_arc)*/ /*Preload (dependencies: lv_arc)*/
#define USE_LV_PRELOAD 1 #define USE_LV_PRELOAD 1
#if USE_LV_PRELOAD != 0 #if USE_LV_PRELOAD != 0
#define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/ # define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/
#define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/ # define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/
#define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC # define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
#endif #endif
/*Canvas (dependencies: lv_img)*/ /*Canvas (dependencies: lv_img)*/
@ -327,13 +335,13 @@
/*Button (dependencies: lv_cont*/ /*Button (dependencies: lv_cont*/
#define USE_LV_BTN 1 #define USE_LV_BTN 1
#if USE_LV_BTN != 0 #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 #endif
/*Image Button (dependencies: lv_btn*/ /*Image Button (dependencies: lv_btn*/
#define USE_LV_IMGBTN 1 #define USE_LV_IMGBTN 1
#if USE_LV_IMGBTN #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 #endif
/*Button matrix (dependencies: -)*/ /*Button matrix (dependencies: -)*/
@ -348,19 +356,19 @@
/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/ /*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
#define USE_LV_LIST 1 #define USE_LV_LIST 1
#if USE_LV_LIST != 0 #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 #endif
/*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/ /*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
#define USE_LV_DDLIST 1 #define USE_LV_DDLIST 1
#if USE_LV_DDLIST != 0 #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 #endif
/*Roller (dependencies: lv_ddlist)*/ /*Roller (dependencies: lv_ddlist)*/
#define USE_LV_ROLLER 1 #define USE_LV_ROLLER 1
#if USE_LV_ROLLER != 0 #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 #endif
/*Slider (dependencies: lv_bar)*/ /*Slider (dependencies: lv_bar)*/
@ -373,7 +381,7 @@
* Non-user section * Non-user section
*************************/ *************************/
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/ #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 #endif
/*--END OF LV_CONF_H--*/ /*--END OF LV_CONF_H--*/