add return value to lv_task_handler. resolves #708
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user