From d0a9e8b817132335db504543c16437adf0a244b5 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 22 Apr 2024 18:13:02 +0200 Subject: [PATCH] update lv_conf_internal.h --- scripts/lv_conf_internal_gen.py | 5 +++++ src/core/lv_global.h | 4 ++-- src/core/lv_refr.c | 2 +- src/display/lv_display.c | 4 ++-- src/display/lv_display_private.h | 6 +++--- src/lv_conf_internal.h | 7 ++++++- src/osal/lv_windows.c | 1 + src/others/sysmon/lv_sysmon.c | 25 ++++++++----------------- src/others/sysmon/lv_sysmon.h | 3 --- tests/src/test_cases/widgets/test_arc.c | 2 +- 10 files changed, 29 insertions(+), 30 deletions(-) diff --git a/scripts/lv_conf_internal_gen.py b/scripts/lv_conf_internal_gen.py index 0769625a6..43a14c912 100755 --- a/scripts/lv_conf_internal_gen.py +++ b/scripts/lv_conf_internal_gen.py @@ -189,6 +189,11 @@ LV_EXPORT_CONST_INT(LV_DRAW_BUF_ALIGN); #define LV_LOG_TRACE_ANIM 0 #endif /*LV_USE_LOG*/ +#if LV_USE_SYSMON == 0 + #define LV_USE_PERF_MONITOR 0 + #define LV_USE_MEM_MONITOR 0 +#endif /*LV_USE_SYSMON*/ + #ifndef LV_USE_LZ4 #define LV_USE_LZ4 (LV_USE_LZ4_INTERNAL || LV_USE_LZ4_EXTERNAL) #endif diff --git a/src/core/lv_global.h b/src/core/lv_global.h index 02462f9d5..930c9951e 100644 --- a/src/core/lv_global.h +++ b/src/core/lv_global.h @@ -191,11 +191,11 @@ typedef struct _lv_global_t { lv_style_t fe_list_button_style; #endif -#if LV_USE_SYSMON && LV_USE_PERF_MONITOR +#if LV_USE_PERF_MONITOR lv_sysmon_backend_data_t sysmon_perf; #endif -#if LV_USE_SYSMON && LV_USE_MEM_MONITOR +#if LV_USE_MEM_MONITOR lv_sysmon_backend_data_t sysmon_mem; #endif diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c index 1dfbab79f..a59686803 100644 --- a/src/core/lv_refr.c +++ b/src/core/lv_refr.c @@ -331,7 +331,7 @@ void _lv_display_refr_timer(lv_timer_t * tmr) /* Ensure the timer does not run again automatically. * This is done before refreshing in case refreshing invalidates something else. * However if the performance monitor is enabled keep the timer running to count the FPS.*/ -#if !(defined(LV_USE_PERF_MONITOR) && LV_USE_PERF_MONITOR) +#if LV_USE_PERF_MONITOR lv_timer_pause(tmr); #endif } diff --git a/src/display/lv_display.c b/src/display/lv_display.c index ba5bf4a8e..1d4a63143 100644 --- a/src/display/lv_display.c +++ b/src/display/lv_display.c @@ -140,11 +140,11 @@ lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res) lv_timer_ready(disp->refr_timer); /*Be sure the screen will be refreshed immediately on start up*/ -#if defined(LV_USE_PERF_MONITOR) && LV_USE_PERF_MONITOR +#if LV_USE_PERF_MONITOR lv_sysmon_show_performance(disp); #endif -#if defined(LV_USE_MEM_MONITOR) && LV_USE_MEM_MONITOR +#if LV_USE_MEM_MONITOR lv_sysmon_show_memory(disp); #endif diff --git a/src/display/lv_display_private.h b/src/display/lv_display_private.h index 14db1ac1b..cbec88e87 100644 --- a/src/display/lv_display_private.h +++ b/src/display/lv_display_private.h @@ -18,7 +18,7 @@ extern "C" { #include "../draw/lv_draw.h" #include "lv_display.h" -#if defined(LV_USE_PERF_MONITOR) && LV_USE_PERF_MONITOR +#if LV_USE_PERF_MONITOR #include "../others/sysmon/lv_sysmon.h" #endif @@ -153,13 +153,13 @@ struct _lv_display_t { /** The area being refreshed*/ lv_area_t refreshed_area; -#if defined(LV_USE_PERF_MONITOR) && LV_USE_PERF_MONITOR +#if LV_USE_PERF_MONITOR lv_obj_t * perf_label; lv_sysmon_backend_data_t perf_sysmon_backend; lv_sysmon_perf_info_t perf_sysmon_info; #endif -#if defined(LV_USE_MEM_MONITOR) && LV_USE_MEM_MONITOR +#if LV_USE_MEM_MONITOR lv_obj_t * mem_label; #endif diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 1ba5be357..cd2d1fde8 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -349,7 +349,7 @@ #define LV_USE_NATIVE_HELIUM_ASM 0 #endif #endif - + /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ #ifndef LV_DRAW_SW_COMPLEX @@ -3283,6 +3283,11 @@ LV_EXPORT_CONST_INT(LV_DRAW_BUF_ALIGN); #define LV_LOG_TRACE_ANIM 0 #endif /*LV_USE_LOG*/ +#if LV_USE_SYSMON == 0 + #define LV_USE_PERF_MONITOR 0 + #define LV_USE_MEM_MONITOR 0 +#endif /*LV_USE_SYSMON*/ + #ifndef LV_USE_LZ4 #define LV_USE_LZ4 (LV_USE_LZ4_INTERNAL || LV_USE_LZ4_EXTERNAL) #endif diff --git a/src/osal/lv_windows.c b/src/osal/lv_windows.c index 0d6a33d66..f15f6aed1 100644 --- a/src/osal/lv_windows.c +++ b/src/osal/lv_windows.c @@ -197,6 +197,7 @@ lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync) return LV_RESULT_OK; } + /********************** * STATIC FUNCTIONS **********************/ diff --git a/src/others/sysmon/lv_sysmon.c b/src/others/sysmon/lv_sysmon.c index 8bf53e4ed..e372ad2cc 100644 --- a/src/others/sysmon/lv_sysmon.c +++ b/src/others/sysmon/lv_sysmon.c @@ -23,17 +23,8 @@ #define SYSMON_REFR_PERIOD_DEF 300 /* ms */ -#if defined(LV_USE_PERF_MONITOR) && LV_USE_PERF_MONITOR - #define _USE_PERF_MONITOR 1 -#else - #define _USE_PERF_MONITOR 0 -#endif - #if defined(LV_USE_MEM_MONITOR) && LV_USE_MEM_MONITOR #define sysmon_mem LV_GLOBAL_DEFAULT()->sysmon_mem - #define _USE_MEM_MONITOR 1 -#else - #define _USE_MEM_MONITOR 0 #endif /********************** @@ -44,13 +35,13 @@ * STATIC PROTOTYPES **********************/ -#if _USE_PERF_MONITOR +#if LV_USE_PERF_MONITOR static void perf_update_timer_cb(lv_timer_t * t); static void perf_observer_cb(lv_observer_t * observer, lv_subject_t * subject); static void perf_monitor_disp_event_cb(lv_event_t * e); #endif -#if _USE_MEM_MONITOR +#if LV_USE_MEM_MONITOR static void mem_update_timer_cb(lv_timer_t * t); static void mem_observer_cb(lv_observer_t * observer, lv_subject_t * subject); #endif @@ -70,7 +61,7 @@ void _lv_sysmon_builtin_init(void) { -#if _USE_MEM_MONITOR +#if LV_USE_MEM_MONITOR static lv_mem_monitor_t mem_info; lv_subject_init_pointer(&sysmon_mem.subject, &mem_info); sysmon_mem.timer = lv_timer_create(mem_update_timer_cb, SYSMON_REFR_PERIOD_DEF, &mem_info); @@ -79,7 +70,7 @@ void _lv_sysmon_builtin_init(void) void _lv_sysmon_builtin_deinit(void) { -#if _USE_MEM_MONITOR +#if LV_USE_MEM_MONITOR lv_timer_delete(sysmon_mem.timer); #endif } @@ -97,7 +88,7 @@ lv_obj_t * lv_sysmon_create(lv_display_t * disp) return label; } -#if _USE_PERF_MONITOR +#if LV_USE_PERF_MONITOR void lv_sysmon_show_performance(lv_display_t * disp) { @@ -124,7 +115,7 @@ void lv_sysmon_hide_performance(lv_display_t * disp) #endif -#if _USE_MEM_MONITOR +#if LV_USE_MEM_MONITOR void lv_sysmon_show_memory(lv_display_t * disp) { @@ -148,7 +139,7 @@ void lv_sysmon_hide_memory(lv_display_t * disp) * STATIC FUNCTIONS **********************/ -#if _USE_PERF_MONITOR +#if LV_USE_PERF_MONITOR static void perf_monitor_disp_event_cb(lv_event_t * e) { @@ -275,7 +266,7 @@ static void perf_observer_cb(lv_observer_t * observer, lv_subject_t * subject) #endif -#if _USE_MEM_MONITOR +#if LV_USE_MEM_MONITOR static void mem_update_timer_cb(lv_timer_t * t) { diff --git a/src/others/sysmon/lv_sysmon.h b/src/others/sysmon/lv_sysmon.h index 6db4c5943..e106eadd5 100644 --- a/src/others/sysmon/lv_sysmon.h +++ b/src/others/sysmon/lv_sysmon.h @@ -76,7 +76,6 @@ struct _lv_sysmon_perf_info_t { /********************** * GLOBAL PROTOTYPES **********************/ -#if LV_USE_SYSMON /** * Create a new system monitor label @@ -117,8 +116,6 @@ void lv_sysmon_hide_memory(lv_display_t * disp); #endif /*LV_USE_MEM_MONITOR*/ -#endif /*LV_USE_SYSMON*/ - /** * Initialize built-in system monitor, such as performance and memory monitor. */ diff --git a/tests/src/test_cases/widgets/test_arc.c b/tests/src/test_cases/widgets/test_arc.c index 5249ab551..968ce89b3 100644 --- a/tests/src/test_cases/widgets/test_arc.c +++ b/tests/src/test_cases/widgets/test_arc.c @@ -182,7 +182,7 @@ void test_arc_click_sustained_from_start_to_end_does_not_set_value_to_max(void) lv_test_mouse_release(); lv_test_indev_wait(50); - TEST_ASSERT_EQUAL_UINT32(0, event_cnt); + TEST_ASSERT_EQUAL_UINT32(1, event_cnt); TEST_ASSERT_EQUAL_INT32(lv_arc_get_min_value(arc), lv_arc_get_value(arc)); /* Click close to end angle */