Description
I’m using v7.11 for my GUI and refresh my screen through LVGL Task. But I found that the task execution interval can’t meet its original setting through “lv_task_create”, e.g. the interval is 250ms, it should execute every 250ms, but now the task funciton been called 4 times every 250ms, what happened here?
I implemented more than one task, is it possible this test task been affected by others?
What MCU/Processor/Board and compiler are you using?
NXP i.MXRT1062;
IAR
What LVGL version are you using?
v7.11
What do you want to achieve?
Make the task execution stable
What have you tried so far?
I created a test Task which just print out the clock value (FreeRTOS clocks)
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
int main(void)
{
xTaskCreate(vGUI_Task, "littlevgl", configMINIMAL_STACK_SIZE + 6000, NULL, tskIDLE_PRIORITY + 3, &xGUI_TaskHandle);
vTaskStartScheduler();
for (;;) /* should never get here */
{
configASSERT(0);
}
}
void vGUI_Task(void *param)
{
lv_init();
lv_port_disp_init();
lv_port_indev_init();
/* Notify that the LVGL has ready so enable the LVGL tick */
g_lvgl_initialized = true;
SplashWinTimerCreate();
for (;;)
{
lv_task_handler();
vTaskDelay(5);
}
configASSERT(0);
vTaskDelete( NULL );
}
static TickType_t xLastClkTimerTest;
static TickType_t xCurrClkTimerTest;
lv_task_t* SplashWinTimerCreate(void)
{
lv_task_t* tsk = NULL;
static uint32_t timerTest_id = 10;
lv_task_t* tskTest = lv_task_create(testTask, 250, LV_TASK_PRIO_MID, &timerTest_id);
PRINTMSG(LOG_PRIO_INFO, "Timer created!\r\n");
xLastClkTimer = xTaskGetTickCount();
xLastClkTimerTest = xTaskGetTickCount();
return tsk;
}
static void testTask(lv_task_t* tsk)
{
xCurrClkTimerTest = xTaskGetTickCount();
char str[128];
sprintf(str, "SPLASHWIN Test Timer Interval: %d.\r\n", xCurrClkTimerTest - xLastClkTimerTest);
PRINTMSG(LOG_PRIO_INFO, str);
xLastClkTimerTest = xCurrClkTimerTest;
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.