Various improvements (#21)

* T-Deck stability and naming improvements

* allow main task to clean itself up

* remove unused includes

* various lvgl improvements

* added docs
This commit is contained in:
Ken Van Hoeylandt
2024-01-27 23:13:17 +01:00
committed by GitHub
parent a2f0399c9f
commit 7a7b31e426
17 changed files with 146 additions and 138 deletions
+12 -5
View File
@@ -6,14 +6,17 @@
#define TAG "tdeck_lvgl"
lv_disp_t* lilygo_tdeck_init_display();
bool lilygo_tdeck_init_touch(esp_lcd_panel_io_handle_t* io_handle, esp_lcd_touch_handle_t* touch_handle);
lv_disp_t* tdeck_init_display();
void tdeck_enable_backlight();
bool tdeck_init_touch(esp_lcd_panel_io_handle_t* io_handle, esp_lcd_touch_handle_t* touch_handle);
bool lilygo_init_lvgl() {
bool tdeck_init_lvgl() {
static lv_disp_t* display = NULL;
static esp_lcd_panel_io_handle_t touch_io_handle;
static esp_lcd_touch_handle_t touch_handle;
// Init LVGL Port library
const lvgl_port_cfg_t lvgl_cfg = {
.task_priority = ThreadPriorityHigh,
.task_stack = 8096,
@@ -28,14 +31,16 @@ bool lilygo_init_lvgl() {
}
// Add display
display = lilygo_tdeck_init_display();
display = tdeck_init_display();
if (display == NULL) {
TT_LOG_E(TAG, "failed to add display");
return false;
}
// Add touch
if (!lilygo_tdeck_init_touch(&touch_io_handle, &touch_handle)) {
if (!tdeck_init_touch(&touch_io_handle, &touch_handle)) {
return false;
}
@@ -55,5 +60,7 @@ bool lilygo_init_lvgl() {
keyboard_alloc(display);
tdeck_enable_backlight();
return true;
}