From eee2184d107c9fe4c1ba10df5955acc346154481 Mon Sep 17 00:00:00 2001 From: DaPa Date: Tue, 16 Jun 2020 14:10:51 +0300 Subject: [PATCH] Revert part of last commit to keep _xcb naming into lv_task_create --- src/lv_misc/lv_task.c | 8 +++++--- src/lv_misc/lv_task.h | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index 607c61db2..1779a1272 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -248,19 +248,21 @@ lv_task_t * lv_task_create_basic(void) /** * Create a new lv_task - * @param task_cb a callback which is the task itself. It will be called periodically. + * @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) { lv_task_t * new_task = lv_task_create_basic(); LV_ASSERT_MEM(new_task); if(new_task == NULL) return NULL; - lv_task_set_cb(new_task, task_cb); + lv_task_set_cb(new_task, task_xcb); lv_task_set_period(new_task, period); lv_task_set_prio(new_task, prio); new_task->user_data = user_data; diff --git a/src/lv_misc/lv_task.h b/src/lv_misc/lv_task.h index 052574f40..bfd428369 100644 --- a/src/lv_misc/lv_task.h +++ b/src/lv_misc/lv_task.h @@ -96,13 +96,15 @@ lv_task_t * lv_task_create_basic(void); /** * Create a new lv_task - * @param task_cb a callback which is the task itself. It will be called periodically. + * @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