1 /**
2  * @file lv_test_conf.h
3  *
4  */
5 
6 #ifndef LV_TEST_CONF_H
7 #define LV_TEST_CONF_H
8 
9 #define LV_CONF_SUPPRESS_DEFINE_CHECK 1
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /***********************
16  * PLATFORM CONFIGS
17  ***********************/
18 
19 #ifdef LVGL_CI_USING_SYS_HEAP
20 #define LV_USE_STDLIB_MALLOC        LV_STDLIB_CLIB
21 #define LV_USE_STDLIB_STRING        LV_STDLIB_CLIB
22 #define LV_USE_STDLIB_SPRINTF       LV_STDLIB_CLIB
23 #define LV_USE_OS                   LV_OS_PTHREAD
24 #define LV_OBJ_STYLE_CACHE          0
25 #define LV_BIN_DECODER_RAM_LOAD     1   /* Run test with bin image loaded to RAM */
26 #endif
27 
28 #ifdef LVGL_CI_USING_DEF_HEAP
29 #define LV_USE_STDLIB_MALLOC    LV_STDLIB_BUILTIN
30 #define LV_USE_STDLIB_STRING    LV_STDLIB_BUILTIN
31 #define LV_USE_STDLIB_SPRINTF   LV_STDLIB_BUILTIN
32 #define LV_OBJ_STYLE_CACHE      1
33 #define LV_BIN_DECODER_RAM_LOAD 0
34 #endif
35 
36 #ifdef MICROPYTHON
37 #define LV_USE_BUILTIN_MALLOC   0
38 #define LV_USE_BUILTIN_MEMCPY   1
39 #define LV_USE_BUILTIN_SNPRINTF 1
40 #define LV_STDLIB_INCLUDE "include/lv_mp_mem_custom_include.h"
41 #define LV_MALLOC       m_malloc
42 #define LV_REALLOC      m_realloc
43 #define LV_FREE         m_free
44 #define LV_MEMSET       lv_memset_builtin
45 #define LV_MEMCPY       lv_memcpy_builtin
46 #define LV_SNPRINTF     lv_snprintf_builtin
47 #define LV_VSNPRINTF    lv_vsnprintf_builtin
48 #define LV_STRLEN       lv_strlen_builtin
49 #define LV_STRNCPY      lv_strncpy_builtin
50 
51 #define LV_ENABLE_GC 1
52 #define LV_GC_INCLUDE "py/mpstate.h"
53 #define LV_GC_ROOT(x) MP_STATE_PORT(x)
54 #endif
55 
56 #ifndef __ASSEMBLY__
57 void lv_test_assert_fail(void);
58 #define LV_ASSERT_HANDLER lv_test_assert_fail();
59 
60 typedef void * lv_user_data_t;
61 #endif
62 /***********************
63  * TEST CONFIGS
64  ***********************/
65 
66 #if !(defined(LV_TEST_OPTION)) || LV_TEST_OPTION == 5
67 #define  LV_COLOR_DEPTH     32
68 #define  LV_DPI_DEF         160
69 #include "lv_test_conf_full.h"
70 #elif LV_TEST_OPTION == 6
71 #define  LV_COLOR_DEPTH     32
72 #define  LV_DPI_DEF         160
73 
74 #define  LV_DRAW_BUF_ALIGN  64
75 #ifdef _MSC_VER
76 #define  LV_ATTRIBUTE_MEM_ALIGN __declspec(align(LV_DRAW_BUF_ALIGN))
77 #else
78 #define  LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(LV_DRAW_BUF_ALIGN)))
79 #endif
80 
81 #include "lv_test_conf_vg_lite.h"
82 #include "lv_test_conf_full.h"
83 #elif LV_TEST_OPTION == 7
84 #define  LV_COLOR_DEPTH     32
85 #define  LV_DPI_DEF         160
86 #define  LV_USE_DRAW_SDL    1
87 #define  LV_USE_SDL         1
88 #include "lv_test_conf_full.h"
89 #elif LV_TEST_OPTION == 4
90 #define  LV_COLOR_DEPTH     24
91 #define  LV_DPI_DEF         120
92 #elif LV_TEST_OPTION == 3
93 #define  LV_COLOR_DEPTH     16
94 #define  LV_DPI_DEF         90
95 #include "lv_test_conf_minimal.h"
96 #elif LV_TEST_OPTION == 2
97 #define  LV_COLOR_DEPTH     8
98 #define  LV_DPI_DEF         60
99 #include "lv_test_conf_minimal.h"
100 #elif LV_TEST_OPTION == 1
101 #define  LV_COLOR_DEPTH     1
102 #define  LV_DPI_DEF         30
103 #define  LV_DRAW_SW_COMPLEX 0
104 #include "lv_test_conf_minimal.h"
105 #endif
106 
107 #if defined(LVGL_CI_USING_SYS_HEAP) || defined(LVGL_CI_USING_DEF_HEAP)
108 #undef LV_LOG_PRINTF
109 
110 /*Use a large value be sure any issues will cause crash*/
111 #define LV_DRAW_BUF_STRIDE_ALIGN                64
112 
113 #ifndef LV_DRAW_BUF_ALIGN
114 /*Use non power of 2 to avoid the case when `malloc` returns aligned pointer by default, and use a large value be sure any issues will cause crash*/
115 #define LV_DRAW_BUF_ALIGN                       852
116 #endif
117 
118 /*For screenshots*/
119 #undef LV_DPI_DEF
120 #define  LV_DPI_DEF         130
121 #endif
122 
123 #ifdef __cplusplus
124 } /*extern "C"*/
125 #endif
126 
127 #endif /*LV_TEST_CONF_H*/
128