From ecee01fe97422c65e2b01979742d01ece31bc28d Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 23 May 2023 09:00:06 +1000 Subject: Remove audio drain task ISR drain works fine! --- src/ui/lvgl_task.cpp | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'src/ui/lvgl_task.cpp') diff --git a/src/ui/lvgl_task.cpp b/src/ui/lvgl_task.cpp index 6664f754..7924a3d1 100644 --- a/src/ui/lvgl_task.cpp +++ b/src/ui/lvgl_task.cpp @@ -23,8 +23,8 @@ #include "misc/lv_color.h" #include "misc/lv_style.h" #include "misc/lv_timer.h" -#include "touchwheel.hpp" #include "tasks.hpp" +#include "touchwheel.hpp" #include "widgets/lv_label.h" #include "display.hpp" @@ -38,37 +38,39 @@ auto tick_hook(TimerHandle_t xTimer) -> void { lv_tick_inc(1); } -void LvglMain(std::weak_ptr weak_touch_wheel, std::weak_ptr weak_display) { - ESP_LOGI(kTag, "init lvgl"); - lv_init(); +void LvglMain(std::weak_ptr weak_touch_wheel, + std::weak_ptr weak_display) { + ESP_LOGI(kTag, "init lvgl"); + lv_init(); - // LVGL has been initialised, so we can now start reporting ticks to it. - xTimerCreate("lv_tick", pdMS_TO_TICKS(1), pdTRUE, NULL, &tick_hook); + // LVGL has been initialised, so we can now start reporting ticks to it. + xTimerCreate("lv_tick", pdMS_TO_TICKS(1), pdTRUE, NULL, &tick_hook); - lv_style_t style; - lv_style_init(&style); - lv_style_set_text_color(&style, LV_COLOR_MAKE(0xFF, 0, 0)); - // TODO: find a nice bitmap font for this display size and density. - // lv_style_set_text_font(&style, &lv_font_montserrat_24); + lv_style_t style; + lv_style_init(&style); + lv_style_set_text_color(&style, LV_COLOR_MAKE(0xFF, 0, 0)); + // TODO: find a nice bitmap font for this display size and density. + // lv_style_set_text_font(&style, &lv_font_montserrat_24); - auto label = lv_label_create(NULL); - lv_label_set_text(label, "COLOURS!!"); - lv_obj_add_style(label, &style, 0); + auto label = lv_label_create(NULL); + lv_label_set_text(label, "COLOURS!!"); + lv_obj_add_style(label, &style, 0); - lv_obj_center(label); - lv_scr_load(label); + lv_obj_center(label); + lv_scr_load(label); - while (1) { - lv_timer_handler(); - // 30 FPS - // TODO(jacqueline): make this dynamic - vTaskDelay(pdMS_TO_TICKS(33)); - } + while (1) { + lv_timer_handler(); + // 30 FPS + // TODO(jacqueline): make this dynamic + vTaskDelay(pdMS_TO_TICKS(33)); + } } auto StartLvgl(std::weak_ptr touch_wheel, std::weak_ptr display) -> void { - tasks::StartPersistent([=]() { LvglMain(touch_wheel, display); }); + tasks::StartPersistent( + [=]() { LvglMain(touch_wheel, display); }); } } // namespace ui -- cgit v1.2.3