summaryrefslogtreecommitdiff
path: root/src/ui/include/lvgl_task.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/include/lvgl_task.hpp')
-rw-r--r--src/ui/include/lvgl_task.hpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/ui/include/lvgl_task.hpp b/src/ui/include/lvgl_task.hpp
index 7e60c4b4..6b7e446e 100644
--- a/src/ui/include/lvgl_task.hpp
+++ b/src/ui/include/lvgl_task.hpp
@@ -12,15 +12,38 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
+#include "freertos/timers.h"
#include "display.hpp"
#include "relative_wheel.hpp"
+#include "screen.hpp"
#include "themes.hpp"
#include "touchwheel.hpp"
+#include "wheel_encoder.hpp"
namespace ui {
-auto StartLvgl(std::weak_ptr<drivers::RelativeWheel> touch_wheel,
- std::weak_ptr<drivers::Display> display) -> void;
+class UiTask {
+ public:
+ static auto Start() -> UiTask*;
+
+ ~UiTask();
+
+ // FIXME: Once we have more input devices, this function should accept a more
+ // generic interface.
+ auto SetInputDevice(std::shared_ptr<TouchWheelEncoder> dev) -> void;
+
+ private:
+ UiTask();
+
+ auto Main() -> void;
+
+ std::shared_ptr<TouchWheelEncoder> input_device_;
+ std::shared_ptr<Screen> current_screen_;
+
+ std::atomic<bool> quit_;
+ SemaphoreHandle_t frame_semaphore_;
+ TimerHandle_t frame_timer_;
+};
} // namespace ui