From 1e2b1988aa205d096939c7401a3b971e4814af8d Mon Sep 17 00:00:00 2001 From: VIFEX Date: Mon, 1 Jul 2024 21:23:22 +0800 Subject: [PATCH] feat(refr): add details on rendering_in_progress ASSERT cause (#6450) Signed-off-by: FASTSHIFT --- src/core/lv_refr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c index 75308ac8a..1b8d26c06 100644 --- a/src/core/lv_refr.c +++ b/src/core/lv_refr.c @@ -254,6 +254,17 @@ void _lv_inv_area(lv_display_t * disp, const lv_area_t * area_p) if(!disp) return; if(!lv_display_is_invalidation_enabled(disp)) return; + /** + * There are two reasons for this issue: + * 1.LVGL API is being used across threads, such as modifying widget properties in another thread + * or within an interrupt handler during the main thread rendering process. + * 2.User-customized widget modify widget properties/styles again within the DRAW event. + * + * Therefore, ensure that LVGL is used in a single-threaded manner, or refer to + * documentation: https://docs.lvgl.io/master/porting/os.html for proper locking mechanisms. + * Additionally, ensure that only drawing-related tasks are performed within the DRAW event, + * and move widget property/style modifications to other events. + */ LV_ASSERT_MSG(!disp->rendering_in_progress, "Invalidate area is not allowed during rendering."); /*Clear the invalidate buffer if the parameter is NULL*/