Skip to content

Commit

Permalink
lv_timer_handler in Task
Browse files Browse the repository at this point in the history
  • Loading branch information
jgauchia committed Jul 1, 2024
1 parent e0f0fe3 commit dc6ff3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
8 changes: 5 additions & 3 deletions lib/tasks/tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

time_t local, utc = 0;

TaskHandle_t LVGLTaskHandler;

/**
* @brief Task1 - LVGL Task
*
Expand All @@ -19,10 +21,10 @@ void lvglTask(void *pvParameters)
{
log_v("Task1 - LVGL Task - running on core %d", xPortGetCoreID());
log_v("Stack size: %d", uxTaskGetStackHighWaterMark(NULL));
for (;;)
while (1)
{
lv_timer_handler();
vTaskDelay(pdMS_TO_TICKS(TASK_SLEEP_PERIOD_MS));
vTaskDelay(5);
}
}

Expand All @@ -32,7 +34,7 @@ void lvglTask(void *pvParameters)
*/
void initLvglTask()
{
xTaskCreatePinnedToCore(lvglTask, PSTR("LVGL Task"), 20000, NULL, 2, NULL, 1);
xTaskCreatePinnedToCore(lvglTask, PSTR("LVGL Task"), 20000, NULL, 1, &LVGLTaskHandler, 0);
delay(500);
}

Expand Down
10 changes: 2 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ void setup()
mapTempSprite.createSprite(TILE_WIDTH, TILE_HEIGHT);

splashScreen();
//initLvglTask();
initGpsTask();

#ifdef DEFAULT_LAT
loadMainScreen();
#else
lv_screen_load(searchSatScreen);
#endif
initLvglTask();

#ifndef DISABLE_CLI
initCLI();
Expand All @@ -103,11 +103,5 @@ void setup()
*/
void loop()
{
// lv_timer_handler();
// lv_tick_inc(5);
if (!waitScreenRefresh)
{
lv_timer_handler();
vTaskDelay(pdMS_TO_TICKS(TASK_SLEEP_PERIOD_MS));
}
vTaskSuspend(NULL);
}

0 comments on commit dc6ff3b

Please sign in to comment.