阿这,又挂了,那我直接贴代码
页面上的定时器,用于更新rtc
[C] 纯文本查看 复制代码 static void Task_Create(void)
{
timer = lv_timer_create(Task_1000msUpdata, 1000, NULL);
}
guitask里面只需要进行初始化和加线程锁
[C] 纯文本查看 复制代码 void gui_task(void *param)
{
gui_init();
while (1)
{
if (pdTRUE == xSemaphoreTake(xMutex, portMAX_DELAY))
{
lv_timer_handler();
xSemaphoreGive(xMutex);
delay_ms(5);
}
}
}
调试lvgl的话在lv_conf.h中找到LV_USE_LOG这个宏
[C] 纯文本查看 复制代码 #define LV_USE_LOG 1
#if LV_USE_LOG
/*How important log should be added:
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
*LV_LOG_LEVEL_INFO Log important events
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
*LV_LOG_LEVEL_USER Only logs added by the user
*LV_LOG_LEVEL_NONE Do not log anything*/
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
|