add mutex to lv_task_handler to avoid concurent call

This commit is contained in:
Gabor Kiss-Vamosi
2018-08-28 14:41:32 +02:00
parent fe7971759c
commit c335e46384

View File

@@ -58,6 +58,11 @@ LV_ATTRIBUTE_TASK_HANDLER void 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;
task_handler_mutex = true;
static uint32_t idle_period_start = 0;
static uint32_t handler_start = 0;
static uint32_t busy_time = 0;
@@ -131,6 +136,8 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
}
task_handler_mutex = false; /*Release the mutex*/
LV_LOG_TRACE("lv_task_handler ready");
}