add return value to lv_task_handler. resolves #708

This commit is contained in:
Gabor Kiss-Vamosi
2019-01-13 07:44:43 +01:00
parent d76b9c5b17
commit 088936e7f8
2 changed files with 7 additions and 4 deletions

View File

@@ -56,21 +56,22 @@ void lv_task_init(void)
/**
* Call it periodically to handle lv_tasks.
* @return true: no error; false: error ocurred
*/
LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
LV_ATTRIBUTE_TASK_HANDLER bool lv_task_handler(void)
{
LV_LOG_TRACE("lv_task_handler started");
/*Avoid concurrent running of the task handler*/
static bool task_handler_mutex = false;
if(task_handler_mutex) return;
if(task_handler_mutex) return true;
task_handler_mutex = true;
static uint32_t idle_period_start = 0;
static uint32_t handler_start = 0;
static uint32_t busy_time = 0;
if(lv_task_run == false) return;
if(lv_task_run == false) return true;
handler_start = lv_tick_get();
@@ -148,6 +149,7 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
task_handler_mutex = false; /*Release the mutex*/
LV_LOG_TRACE("lv_task_handler ready");
return true;
}
/**