sim: LittleVgl: remove touchPanel from constructor as done upstream

InfiniTime removed the `Pinetime::Drivers::Cst816S& touchPanel`
reference from the LittleVGL constructor. Update that in the simulator
to stay compatible
This commit is contained in:
Reinhold Gschweicher 2023-02-26 23:11:00 +01:00
parent 3a0ee34be5
commit 44452ccdf6
3 changed files with 11 additions and 14 deletions

View File

@ -330,7 +330,7 @@ Pinetime::Drivers::Cst816S touchPanel; // {twiMaster, touchPanelTwiAddress};
// #include "displayapp/LittleVgl.h" // #include "displayapp/LittleVgl.h"
// #include "displayapp/DisplayApp.h" // #include "displayapp/DisplayApp.h"
//#endif //#endif
Pinetime::Components::LittleVgl lvgl {lcd, touchPanel}; Pinetime::Components::LittleVgl lvgl {lcd};
Pinetime::Drivers::Bma421 motionSensor {twiMaster, motionSensorTwiAddress}; Pinetime::Drivers::Bma421 motionSensor {twiMaster, motionSensorTwiAddress};
Pinetime::Drivers::Hrs3300 heartRateSensor {twiMaster, heartRateSensorTwiAddress}; Pinetime::Drivers::Hrs3300 heartRateSensor {twiMaster, heartRateSensorTwiAddress};

View File

@ -19,6 +19,12 @@
using namespace Pinetime::Components; using namespace Pinetime::Components;
namespace {
void InitTheme() {
lv_theme_t* theme = lv_pinetime_theme_init();
lv_theme_set_act(theme);
}
}
lv_style_t* LabelBigStyle = nullptr; lv_style_t* LabelBigStyle = nullptr;
static void disp_flush(lv_disp_drv_t* disp_drv, const lv_area_t* area, lv_color_t* color_p) { static void disp_flush(lv_disp_drv_t* disp_drv, const lv_area_t* area, lv_color_t* color_p) {
@ -41,8 +47,7 @@ bool touchpad_read(lv_indev_drv_t* indev_drv, lv_indev_data_t* data) {
return lvgl->GetTouchPadInfo(data); return lvgl->GetTouchPadInfo(data);
} }
LittleVgl::LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel) LittleVgl::LittleVgl(Pinetime::Drivers::St7789& lcd) : lcd {lcd} {
: lcd {lcd}, touchPanel {touchPanel} {
} }
void LittleVgl::Init() { void LittleVgl::Init() {
@ -304,10 +309,3 @@ bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
} }
return false; return false;
} }
void LittleVgl::InitTheme() {
lv_theme_t* th = lv_pinetime_theme_init();
lv_theme_set_act(th);
}

View File

@ -4,7 +4,6 @@
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {
class Cst816S;
class St7789; class St7789;
} }
@ -12,7 +11,7 @@ namespace Pinetime {
class LittleVgl { class LittleVgl {
public: public:
enum class FullRefreshDirections { None, Up, Down, Left, Right, LeftAnim, RightAnim }; enum class FullRefreshDirections { None, Up, Down, Left, Right, LeftAnim, RightAnim };
LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel); LittleVgl(Pinetime::Drivers::St7789& lcd);
LittleVgl(const LittleVgl&) = delete; LittleVgl(const LittleVgl&) = delete;
LittleVgl& operator=(const LittleVgl&) = delete; LittleVgl& operator=(const LittleVgl&) = delete;
@ -38,10 +37,8 @@ namespace Pinetime {
private: private:
void InitDisplay(); void InitDisplay();
void InitTouchpad(); void InitTouchpad();
void InitTheme();
Pinetime::Drivers::St7789& lcd; Pinetime::Drivers::St7789& lcd;
Pinetime::Drivers::Cst816S& touchPanel;
lv_disp_buf_t disp_buf_2; lv_disp_buf_t disp_buf_2;
lv_color_t buf2_1[LV_HOR_RES_MAX * 4]; lv_color_t buf2_1[LV_HOR_RES_MAX * 4];
@ -53,9 +50,11 @@ namespace Pinetime {
static constexpr uint8_t nbWriteLines = 4; static constexpr uint8_t nbWriteLines = 4;
static constexpr uint16_t totalNbLines = 320; static constexpr uint16_t totalNbLines = 320;
static constexpr uint16_t visibleNbLines = 240; static constexpr uint16_t visibleNbLines = 240;
static constexpr uint8_t MaxScrollOffset() { static constexpr uint8_t MaxScrollOffset() {
return LV_VER_RES_MAX - nbWriteLines; return LV_VER_RES_MAX - nbWriteLines;
} }
FullRefreshDirections scrollDirection = FullRefreshDirections::None; FullRefreshDirections scrollDirection = FullRefreshDirections::None;
uint16_t writeOffset = 0; uint16_t writeOffset = 0;
uint16_t scrollOffset = 0; uint16_t scrollOffset = 0;