From b1213dcc5908cad1ce861c1f146724a73653708f Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 14 Jul 2020 15:25:56 +0200 Subject: [PATCH] remove lv_event_queue_refresh_recursive keep only the synchronous functions for refresh for easier maintanance --- CHANGELOG.md | 2 +- src/lv_core/lv_obj.c | 36 ------------------------------------ src/lv_core/lv_obj.h | 8 -------- 3 files changed, 1 insertion(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index adddee5f0..7d81cb749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Available in the `dev` branch ### New features - Add `lv_task_get_next` -- Add `lv_event_send_refresh`, `lv_event_send_refresh_recursive`, `lv_event_queue_refresh_recursive` to easily send `LV_EVENT_REFRESH` to object +- Add `lv_event_send_refresh`, `lv_event_send_refresh_recursive` to easily send `LV_EVENT_REFRESH` to object - Add `lv_tabview_set_tab_name()` function - used to change a tab's name ## v7.2.0 (planned on 21.07.2020) diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index 2b414addb..1ff68317c 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -98,7 +98,6 @@ static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v); static void fade_in_anim_ready(lv_anim_t * a); #endif static void lv_event_mark_deleted(lv_obj_t * obj); -static void refresh_event_task_cb(lv_task_t * t); static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find); static void lv_obj_del_async_cb(void * obj); static void obj_del_core(lv_obj_t * obj); @@ -1796,26 +1795,6 @@ void lv_event_send_refresh_recursive(lv_obj_t * obj) } } -/** - * Queue the sending of LV_EVENT_REFRESH event to an object and all of its children. - * The events won't be sent immediately but after `LV_DISP_DEF_REFR_PERIOD` delay. - * It is useful to refresh object only on a reasonable rate if this function is called very often. - * @param obj pointer to an object or NULL to refresh all objects of all displays - */ -void lv_event_queue_refresh_recursive(lv_obj_t * obj) -{ - lv_task_t * t = lv_task_get_next(NULL); - while(t) { - /* REturn if a refresh is already queued for this object*/ - if(t->task_cb == refresh_event_task_cb && t->user_data == obj) return; - t = lv_task_get_next(t); - } - - /*No queued task for this object so create one now*/ - t = lv_task_create(refresh_event_task_cb, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, obj); - lv_task_set_repeat_count(t, 1); -} - /** * Call an event function with an object, event, and data. @@ -3535,16 +3514,6 @@ static void obj_del_core(lv_obj_t * obj) /*Let the user free the resources used in `LV_EVENT_DELETE`*/ lv_event_send(obj, LV_EVENT_DELETE, NULL); - /*Delete queued refresh queries*/ - lv_task_t * t = lv_task_get_next(NULL); - while(t) { - if(t->user_data == obj && t->task_cb == refresh_event_task_cb) { - lv_task_del(t); - break; - } - t = lv_task_get_next(t); - } - /*Delete from the group*/ #if LV_USE_GROUP lv_group_t * group = lv_obj_get_group(obj); @@ -4307,11 +4276,6 @@ static void lv_event_mark_deleted(lv_obj_t * obj) } } -static void refresh_event_task_cb(lv_task_t * t) -{ - lv_event_send_refresh_recursive(t->user_data); -} - static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find) { /*Check all children of `parent`*/ diff --git a/src/lv_core/lv_obj.h b/src/lv_core/lv_obj.h index 0f985ff83..9815d3b9b 100644 --- a/src/lv_core/lv_obj.h +++ b/src/lv_core/lv_obj.h @@ -837,14 +837,6 @@ lv_res_t lv_event_send_refresh(lv_obj_t * obj); */ void lv_event_send_refresh_recursive(lv_obj_t * obj); -/** - * Queue the sending of LV_EVENT_REFRESH event to an object and all of its children. - * The events won't be sent immediately but after `LV_DISP_DEF_REFR_PERIOD` delay. - * It is useful to refresh object only on a reasonable rate if this function is called very often. - * @param obj pointer to an object or NULL to refresh all objects of all displays - */ -void lv_event_queue_refresh_recursive(lv_obj_t * obj); - /** * Call an event function with an object, event, and data. * @param event_xcb an event callback function. If `NULL` `LV_RES_OK` will return without any actions.