Skip to content

Commit cfc6f2f

Browse files
committed
Adapt for the updated LVGL submodules.
1 parent fa4d9e2 commit cfc6f2f

3 files changed

Lines changed: 70 additions & 74 deletions

File tree

LvglWindowsDesktopApplication/lv_conf.h

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @file lv_conf.h
3-
* Configuration file for v9.0.0-dev
3+
* Configuration file for v9.0.0
44
*/
55

66
/*
@@ -42,7 +42,7 @@
4242

4343
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
4444
/*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/
45-
#define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/
45+
#define LV_MEM_SIZE (256 * 1024U) /*[bytes]*/
4646

4747
/*Size of the memory expand for `lv_malloc()` in bytes*/
4848
#define LV_MEM_POOL_EXPAND_SIZE 0
@@ -101,13 +101,16 @@
101101
* > 1 means multiply threads will render the screen in parallel */
102102
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
103103

104+
/* Use Arm-2D to accelerate the sw render */
105+
#define LV_USE_DRAW_ARM2D_SYNC 0
106+
104107
/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode
105108
* it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks.
106109
* "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers
107110
* and can't be drawn in chunks. */
108111

109112
/*The target buffer size for simple layer chunks.*/
110-
#define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/
113+
#define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/
111114

112115
/* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only
113116
* 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */
@@ -133,9 +136,6 @@
133136
#endif
134137
#endif
135138

136-
/* Use Arm-2D on Cortex-M based devices. Please only enable it for Helium Powered devices for now */
137-
#define LV_USE_DRAW_ARM2D 0
138-
139139
/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */
140140
#define LV_USE_DRAW_VGLITE 0
141141

@@ -255,28 +255,6 @@
255255
*For layers add the index number of the draw unit on black background.*/
256256
#define LV_USE_PARALLEL_DRAW_DEBUG 0
257257

258-
/*------------------
259-
* STATUS MONITORING
260-
*------------------*/
261-
262-
/*1: Show CPU usage and FPS count
263-
* Requires `LV_USE_SYSMON = 1`*/
264-
#define LV_USE_PERF_MONITOR 1
265-
#if LV_USE_PERF_MONITOR
266-
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
267-
268-
/*0: Displays performance data on the screen, 1: Prints performance data using log.*/
269-
#define LV_USE_PERF_MONITOR_LOG_MODE 0
270-
#endif
271-
272-
/*1: Show the used memory and the memory fragmentation
273-
* Requires `LV_USE_BUILTIN_MALLOC = 1`
274-
* Requires `LV_USE_SYSMON = 1`*/
275-
#define LV_USE_MEM_MONITOR 1
276-
#if LV_USE_MEM_MONITOR
277-
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
278-
#endif
279-
280258
/*-------------
281259
* Others
282260
*-----------*/
@@ -293,6 +271,10 @@
293271
*If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/
294272
#define LV_CACHE_DEF_SIZE 0
295273

274+
/*Default number of image header cache entries. The cache is used to store the headers of images
275+
*The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/
276+
#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0
277+
296278
/*Number of stops allowed per gradient. Increase this to allow more stops.
297279
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
298280
#define LV_GRADIENT_MAX_STOPS 2
@@ -742,7 +724,30 @@
742724
#define LV_USE_SNAPSHOT 0
743725

744726
/*1: Enable system monitor component*/
745-
#define LV_USE_SYSMON (LV_USE_MEM_MONITOR | LV_USE_PERF_MONITOR)
727+
#define LV_USE_SYSMON 1
728+
#if LV_USE_SYSMON
729+
/*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/
730+
#define LV_SYSMON_GET_IDLE lv_timer_get_idle
731+
732+
/*1: Show CPU usage and FPS count
733+
* Requires `LV_USE_SYSMON = 1`*/
734+
#define LV_USE_PERF_MONITOR 1
735+
#if LV_USE_PERF_MONITOR
736+
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
737+
738+
/*0: Displays performance data on the screen, 1: Prints performance data using log.*/
739+
#define LV_USE_PERF_MONITOR_LOG_MODE 0
740+
#endif
741+
742+
/*1: Show the used memory and the memory fragmentation
743+
* Requires `LV_USE_BUILTIN_MALLOC = 1`
744+
* Requires `LV_USE_SYSMON = 1`*/
745+
#define LV_USE_MEM_MONITOR 1
746+
#if LV_USE_MEM_MONITOR
747+
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
748+
#endif
749+
750+
#endif /*LV_USE_SYSMON*/
746751

747752
/*1: Enable the runtime performance profiler*/
748753
#define LV_USE_PROFILER 0
@@ -781,13 +786,6 @@
781786

782787
/*1: Support using images as font in label or span widgets */
783788
#define LV_USE_IMGFONT 0
784-
#if LV_USE_IMGFONT
785-
/*Imgfont image file path maximum length*/
786-
#define LV_IMGFONT_PATH_MAX_LEN 64
787-
788-
/*1: Use img cache to buffer header information*/
789-
#define LV_IMGFONT_USE_IMAGE_CACHE_HEADER 0
790-
#endif
791789

792790
/*1: Enable an observer pattern implementation*/
793791
#define LV_USE_OBSERVER 1

LvglWindowsSimulator/lv_conf.h

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @file lv_conf.h
3-
* Configuration file for v9.0.0-dev
3+
* Configuration file for v9.0.0
44
*/
55

66
/*
@@ -42,7 +42,7 @@
4242

4343
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
4444
/*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/
45-
#define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/
45+
#define LV_MEM_SIZE (256 * 1024U) /*[bytes]*/
4646

4747
/*Size of the memory expand for `lv_malloc()` in bytes*/
4848
#define LV_MEM_POOL_EXPAND_SIZE 0
@@ -101,13 +101,16 @@
101101
* > 1 means multiply threads will render the screen in parallel */
102102
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
103103

104+
/* Use Arm-2D to accelerate the sw render */
105+
#define LV_USE_DRAW_ARM2D_SYNC 0
106+
104107
/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode
105108
* it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks.
106109
* "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers
107110
* and can't be drawn in chunks. */
108111

109112
/*The target buffer size for simple layer chunks.*/
110-
#define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/
113+
#define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/
111114

112115
/* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only
113116
* 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */
@@ -133,9 +136,6 @@
133136
#endif
134137
#endif
135138

136-
/* Use Arm-2D on Cortex-M based devices. Please only enable it for Helium Powered devices for now */
137-
#define LV_USE_DRAW_ARM2D 0
138-
139139
/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */
140140
#define LV_USE_DRAW_VGLITE 0
141141

@@ -255,28 +255,6 @@
255255
*For layers add the index number of the draw unit on black background.*/
256256
#define LV_USE_PARALLEL_DRAW_DEBUG 0
257257

258-
/*------------------
259-
* STATUS MONITORING
260-
*------------------*/
261-
262-
/*1: Show CPU usage and FPS count
263-
* Requires `LV_USE_SYSMON = 1`*/
264-
#define LV_USE_PERF_MONITOR 1
265-
#if LV_USE_PERF_MONITOR
266-
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
267-
268-
/*0: Displays performance data on the screen, 1: Prints performance data using log.*/
269-
#define LV_USE_PERF_MONITOR_LOG_MODE 0
270-
#endif
271-
272-
/*1: Show the used memory and the memory fragmentation
273-
* Requires `LV_USE_BUILTIN_MALLOC = 1`
274-
* Requires `LV_USE_SYSMON = 1`*/
275-
#define LV_USE_MEM_MONITOR 1
276-
#if LV_USE_MEM_MONITOR
277-
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
278-
#endif
279-
280258
/*-------------
281259
* Others
282260
*-----------*/
@@ -293,6 +271,10 @@
293271
*If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/
294272
#define LV_CACHE_DEF_SIZE 0
295273

274+
/*Default number of image header cache entries. The cache is used to store the headers of images
275+
*The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/
276+
#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0
277+
296278
/*Number of stops allowed per gradient. Increase this to allow more stops.
297279
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
298280
#define LV_GRADIENT_MAX_STOPS 2
@@ -742,7 +724,30 @@
742724
#define LV_USE_SNAPSHOT 0
743725

744726
/*1: Enable system monitor component*/
745-
#define LV_USE_SYSMON (LV_USE_MEM_MONITOR | LV_USE_PERF_MONITOR)
727+
#define LV_USE_SYSMON 1
728+
#if LV_USE_SYSMON
729+
/*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/
730+
#define LV_SYSMON_GET_IDLE lv_timer_get_idle
731+
732+
/*1: Show CPU usage and FPS count
733+
* Requires `LV_USE_SYSMON = 1`*/
734+
#define LV_USE_PERF_MONITOR 1
735+
#if LV_USE_PERF_MONITOR
736+
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
737+
738+
/*0: Displays performance data on the screen, 1: Prints performance data using log.*/
739+
#define LV_USE_PERF_MONITOR_LOG_MODE 0
740+
#endif
741+
742+
/*1: Show the used memory and the memory fragmentation
743+
* Requires `LV_USE_BUILTIN_MALLOC = 1`
744+
* Requires `LV_USE_SYSMON = 1`*/
745+
#define LV_USE_MEM_MONITOR 1
746+
#if LV_USE_MEM_MONITOR
747+
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
748+
#endif
749+
750+
#endif /*LV_USE_SYSMON*/
746751

747752
/*1: Enable the runtime performance profiler*/
748753
#define LV_USE_PROFILER 0
@@ -781,13 +786,6 @@
781786

782787
/*1: Support using images as font in label or span widgets */
783788
#define LV_USE_IMGFONT 0
784-
#if LV_USE_IMGFONT
785-
/*Imgfont image file path maximum length*/
786-
#define LV_IMGFONT_PATH_MAX_LEN 64
787-
788-
/*1: Use img cache to buffer header information*/
789-
#define LV_IMGFONT_USE_IMAGE_CACHE_HEADER 0
790-
#endif
791789

792790
/*1: Enable an observer pattern implementation*/
793791
#define LV_USE_OBSERVER 1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Instructions for cloning, building and running the application are found below.
2323

2424
## Known Issues
2525

26-
- The LV_MEM_SIZE macro in lv_conf.h should be 128KiB or larger because you may
26+
- The LV_MEM_SIZE macro in lv_conf.h should be 128 KiB or larger because you may
2727
meet the out of memory issue when you are using the 64-bit simulator.
28-
- Note: In this project, the size is set to 1024KiB.
28+
- Note: In this project, the size is set to 256 KiB.
2929
- Users need to check the target selected in Visual Studio, because the
3030
simulator project support ARM64 and Visual Studio will choose ARM64 in the
3131
first time because of the alphabetical order.

0 commit comments

Comments
 (0)