Simplify LVGL init: move code into Tactility (#208)

The esp_lvgl_port code was duplicated across all boards, so I moved it into the Tactility subproject to simplify the board implementations.
This commit is contained in:
Ken Van Hoeylandt
2025-02-08 17:06:16 +01:00
committed by GitHub
parent c1f55429b6
commit 8ccba15c25
19 changed files with 49 additions and 160 deletions
+7 -2
View File
@@ -7,6 +7,10 @@
#include <Tactility/hal/Touch.h>
#include <Tactility/kernel/SystemEvents.h>
#ifdef ESP_PLATFORM
#include "Tactility/lvgl/EspLvglPort.h"
#endif
#include <lvgl.h>
namespace tt::lvgl {
@@ -82,10 +86,11 @@ void init(const hal::Configuration& config) {
kernel::systemEventPublish(kernel::SystemEvent::BootInitLvglBegin);
if (config.initLvgl != nullptr && !config.initLvgl()) {
TT_LOG_E(TAG, "LVGL init failed");
#ifdef ESP_PLATFORM
if (config.lvglInit == hal::LvglInit::Default && !initEspLvglPort()) {
return;
}
#endif
auto display = initDisplay(config);
if (display == nullptr) {