#include #include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" #include "rom/gpio.h" #include "driver/gpio.h" #include "esp_log.h" #include "lvgl.h" #include "board.h" #include "esp_timer.h" #define TAG "MAIN" static void increase_lvgl_tick(void* arg) { lv_tick_inc(50); } extern void screen_init(void); void lvgl_task(void* arg) { screen_init(); // Tick interface for LVGL const esp_timer_create_args_t periodic_timer_args = { .callback = increase_lvgl_tick, .name = "periodic_gui" }; esp_timer_handle_t periodic_timer; esp_timer_create(&periodic_timer_args, &periodic_timer); esp_timer_start_periodic(periodic_timer, 50 * 1000); // built in benchmark tool extern void lv_demo_benchmark(void); lv_demo_benchmark(); for (;;) { lv_task_handler(); vTaskDelay(pdMS_TO_TICKS(5)); } } void app_main(void) { //heap_caps_print_heap_info(MALLOC_CAP_SPIRAM); //vTaskDelay(pdMS_TO_TICKS(500)); xTaskCreatePinnedToCore(lvgl_task, NULL, 8 * 1024, NULL, 1, NULL, 1); }