Added lvgl support to generate images. Made basic example, grayscale background + text displayed everytime we call /api/display/image.png

This commit is contained in:
2026-03-14 18:41:00 -04:00
parent a9d5aa83dc
commit 6384e93020
19 changed files with 10019 additions and 5 deletions

View File

@@ -26,6 +26,9 @@
#include "http_server.cpp"
#include "mdns_service.cpp"
#include "udp_logger.cpp"
#include "lodepng_alloc.cpp"
#include "lodepng/lodepng.cpp"
#include "lv_setup.cpp"
// clang-format on
internal const char *kTagMain = "MAIN";
@@ -49,10 +52,17 @@ extern "C" void app_main()
ESP_LOGI(kTagMain, "PSRAM size: %d bytes", esp_psram_get_size());
#if CONFIG_PM_ENABLE
esp_pm_config_t pm_config = {
.max_freq_mhz = 240, .min_freq_mhz = 40, .light_sleep_enable = true};
esp_pm_config_t pm_config = {};
pm_config.max_freq_mhz = 240;
pm_config.min_freq_mhz = 40;
#if CONFIG_CALENDINK_ALLOW_LIGHT_SLEEP
pm_config.light_sleep_enable = true;
#else
pm_config.light_sleep_enable = false;
#endif
esp_pm_configure(&pm_config);
ESP_LOGI(kTagMain, "Dynamic Power Management initialized (Tickless Idle).");
ESP_LOGI(kTagMain, "Dynamic Power Management initialized. Light sleep %s.",
pm_config.light_sleep_enable ? "ENABLED" : "DISABLED");
#endif
httpd_handle_t web_server = NULL;
@@ -271,6 +281,13 @@ extern "C" void app_main()
start_udp_logging(514);
#endif
// Start LVGL
ESP_LOGI(kTagMain, "ABOUT TO START LVGL");
vTaskDelay(pdMS_TO_TICKS(500));
setup_lvgl();
ESP_LOGI(kTagMain, "LVGL STARTED");
vTaskDelay(pdMS_TO_TICKS(500));
// Start the webserver
web_server = start_webserver();