From d84e97721838615707a1c400f6b192fb11abf869 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 20 Jun 2019 06:19:07 +0200 Subject: [PATCH] fix callback conventions --- src/lv_core/lv_obj.h | 6 ++++-- src/lv_misc/lv_task.c | 4 +++- src/lv_misc/lv_task.h | 7 +++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/lv_core/lv_obj.h b/src/lv_core/lv_obj.h index 9e66d161e..d6bc3fc19 100644 --- a/src/lv_core/lv_obj.h +++ b/src/lv_core/lv_obj.h @@ -536,13 +536,15 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data); /** * Call an event function with an object, event, and data. - * @param event_cb an event callback function + * @param event_xcb an event callback function. If `NULL` `LV_RES_OK` will return without any actions. + * (the 'x' in the argument name indicates that its not a fully generic function because it not follows + * the `func_name(object, callback, ...)` convention) * @param obj pointer to an object to associate with the event (can be `NULL` to simply call the `event_cb`) * @param event an event * @param data pointer to a custom data * @return LV_RES_OK: `obj` was not deleted in the event; LV_RES_INV: `obj` was deleted in the event */ -lv_res_t lv_event_send_func(lv_event_cb_t event_cb, lv_obj_t * obj, lv_event_t event, const void * data); +lv_res_t lv_event_send_func(lv_event_cb_t event_xcb, lv_obj_t * obj, lv_event_t event, const void * data); /** * Get the `data` parameter of the current event diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index 51a904ca4..296fa8f91 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -212,7 +212,9 @@ lv_task_t * lv_task_create_basic(void) /** * Create a new lv_task - * @param task a function which is the task itself + * @param task_xcb a callback which is the task itself. It will be called periodically. + * (the 'x' in the argument name indicates that its not a fully generic function because it not follows + * the `func_name(object, callback, ...)` convention) * @param period call period in ms unit * @param prio priority of the task (LV_TASK_PRIO_OFF means the task is stopped) * @param user_data custom parameter diff --git a/src/lv_misc/lv_task.h b/src/lv_misc/lv_task.h index 7b5c2f3df..886944500 100644 --- a/src/lv_misc/lv_task.h +++ b/src/lv_misc/lv_task.h @@ -92,15 +92,18 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void); */ lv_task_t * lv_task_create_basic(void); + /** * Create a new lv_task - * @param task a function which is the task itself + * @param task_xcb a callback which is the task itself. It will be called periodically. + * (the 'x' in the argument name indicates that its not a fully generic function because it not follows + * the `func_name(object, callback, ...)` convention) * @param period call period in ms unit * @param prio priority of the task (LV_TASK_PRIO_OFF means the task is stopped) * @param user_data custom parameter * @return pointer to the new task */ -lv_task_t * lv_task_create(lv_task_cb_t task_cb, uint32_t period, lv_task_prio_t prio, void * user_data); +lv_task_t * lv_task_create(lv_task_cb_t task_xcb, uint32_t period, lv_task_prio_t prio, void * user_data); /** * Delete a lv_task