From 6f942e20ed5881e0b520f4c4f0f1fd2ffb4a3a2b Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 25 Feb 2023 13:29:07 +0200 Subject: LittleVgl: Instantiate in DisplayApp LVGL is only a part of the main DisplayApp. Other "DisplayApps" can be implemented without LVGL. DummyLittleVgl isn't needed anymore and has been removed --- src/displayapp/DisplayApp.cpp | 7 +++--- src/displayapp/DisplayApp.h | 3 +-- src/displayapp/DisplayAppRecovery.cpp | 1 - src/displayapp/DisplayAppRecovery.h | 2 -- src/displayapp/DummyLittleVgl.h | 42 ----------------------------------- 5 files changed, 5 insertions(+), 50 deletions(-) delete mode 100644 src/displayapp/DummyLittleVgl.h (limited to 'src/displayapp') diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index bf1d0e64..d910875e 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -60,7 +60,6 @@ namespace { } DisplayApp::DisplayApp(Drivers::St7789& lcd, - Components::LittleVgl& lvgl, const Drivers::Cst816S& touchPanel, const Controllers::Battery& batteryController, const Controllers::Ble& bleController, @@ -77,7 +76,6 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, Pinetime::Controllers::TouchHandler& touchHandler, Pinetime::Controllers::FS& filesystem) : lcd {lcd}, - lvgl {lvgl}, touchPanel {touchPanel}, batteryController {batteryController}, bleController {bleController}, @@ -92,7 +90,8 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, alarmController {alarmController}, brightnessController {brightnessController}, touchHandler {touchHandler}, - filesystem {filesystem} { + filesystem {filesystem}, + lvgl {lcd} { } void DisplayApp::Start(System::BootErrors error) { @@ -100,6 +99,8 @@ void DisplayApp::Start(System::BootErrors error) { bootError = error; + lvgl.Init(); + if (error == System::BootErrors::TouchController) { LoadNewScreen(Apps::Error, DisplayApp::FullRefreshDirections::None); } else { diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h index 980a4306..f955c213 100644 --- a/src/displayapp/DisplayApp.h +++ b/src/displayapp/DisplayApp.h @@ -52,7 +52,6 @@ namespace Pinetime { enum class FullRefreshDirections { None, Up, Down, Left, Right, LeftAnim, RightAnim }; DisplayApp(Drivers::St7789& lcd, - Components::LittleVgl& lvgl, const Drivers::Cst816S&, const Controllers::Battery& batteryController, const Controllers::Ble& bleController, @@ -79,7 +78,6 @@ namespace Pinetime { private: Pinetime::Drivers::St7789& lcd; - Pinetime::Components::LittleVgl& lvgl; const Pinetime::Drivers::Cst816S& touchPanel; const Pinetime::Controllers::Battery& batteryController; const Pinetime::Controllers::Ble& bleController; @@ -98,6 +96,7 @@ namespace Pinetime { Pinetime::Controllers::FS& filesystem; Pinetime::Controllers::FirmwareValidator validator; + Pinetime::Components::LittleVgl lvgl; TaskHandle_t taskHandle; diff --git a/src/displayapp/DisplayAppRecovery.cpp b/src/displayapp/DisplayAppRecovery.cpp index b9685595..94e83791 100644 --- a/src/displayapp/DisplayAppRecovery.cpp +++ b/src/displayapp/DisplayAppRecovery.cpp @@ -11,7 +11,6 @@ using namespace Pinetime::Applications; DisplayApp::DisplayApp(Drivers::St7789& lcd, - Components::LittleVgl& /*lvgl*/, const Drivers::Cst816S& /*touchPanel*/, const Controllers::Battery& /*batteryController*/, const Controllers::Ble& bleController, diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index 22bad9f9..e30334a6 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -14,7 +14,6 @@ #include "displayapp/TouchEvents.h" #include "displayapp/Apps.h" #include "displayapp/Messages.h" -#include "displayapp/DummyLittleVgl.h" namespace Pinetime { namespace Drivers { @@ -47,7 +46,6 @@ namespace Pinetime { class DisplayApp { public: DisplayApp(Drivers::St7789& lcd, - Components::LittleVgl& lvgl, const Drivers::Cst816S&, const Controllers::Battery& batteryController, const Controllers::Ble& bleController, diff --git a/src/displayapp/DummyLittleVgl.h b/src/displayapp/DummyLittleVgl.h deleted file mode 100644 index 268705da..00000000 --- a/src/displayapp/DummyLittleVgl.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace Pinetime { - namespace Components { - class LittleVgl { - public: - enum class FullRefreshDirections { None, Up, Down }; - - LittleVgl(Pinetime::Drivers::St7789& lcd) { - } - - LittleVgl(const LittleVgl&) = delete; - LittleVgl& operator=(const LittleVgl&) = delete; - LittleVgl(LittleVgl&&) = delete; - LittleVgl& operator=(LittleVgl&&) = delete; - - void Init() { - } - - void FlushDisplay(const lv_area_t* area, lv_color_t* color_p) { - } - - bool GetTouchPadInfo(lv_indev_data_t* ptr) { - return false; - } - - void SetFullRefresh(FullRefreshDirections direction) { - } - - void SetNewTapEvent(uint16_t x, uint16_t y) { - } - - void SetNewTouchPoint(uint16_t x, uint16_t y, bool contact) { - } - }; - } -} -- cgit v1.2.3-70-g09d2