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:
parent
3a0ee34be5
commit
44452ccdf6
2
main.cpp
2
main.cpp
|
@ -330,7 +330,7 @@ Pinetime::Drivers::Cst816S touchPanel; // {twiMaster, touchPanelTwiAddress};
|
|||
// #include "displayapp/LittleVgl.h"
|
||||
// #include "displayapp/DisplayApp.h"
|
||||
//#endif
|
||||
Pinetime::Components::LittleVgl lvgl {lcd, touchPanel};
|
||||
Pinetime::Components::LittleVgl lvgl {lcd};
|
||||
|
||||
Pinetime::Drivers::Bma421 motionSensor {twiMaster, motionSensorTwiAddress};
|
||||
Pinetime::Drivers::Hrs3300 heartRateSensor {twiMaster, heartRateSensorTwiAddress};
|
||||
|
|
|
@ -19,6 +19,12 @@
|
|||
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
LittleVgl::LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel)
|
||||
: lcd {lcd}, touchPanel {touchPanel} {
|
||||
LittleVgl::LittleVgl(Pinetime::Drivers::St7789& lcd) : lcd {lcd} {
|
||||
}
|
||||
|
||||
void LittleVgl::Init() {
|
||||
|
@ -304,10 +309,3 @@ bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LittleVgl::InitTheme() {
|
||||
|
||||
lv_theme_t* th = lv_pinetime_theme_init();
|
||||
|
||||
lv_theme_set_act(th);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
namespace Pinetime {
|
||||
namespace Drivers {
|
||||
class Cst816S;
|
||||
class St7789;
|
||||
}
|
||||
|
||||
|
@ -12,7 +11,7 @@ namespace Pinetime {
|
|||
class LittleVgl {
|
||||
public:
|
||||
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& operator=(const LittleVgl&) = delete;
|
||||
|
@ -38,10 +37,8 @@ namespace Pinetime {
|
|||
private:
|
||||
void InitDisplay();
|
||||
void InitTouchpad();
|
||||
void InitTheme();
|
||||
|
||||
Pinetime::Drivers::St7789& lcd;
|
||||
Pinetime::Drivers::Cst816S& touchPanel;
|
||||
|
||||
lv_disp_buf_t disp_buf_2;
|
||||
lv_color_t buf2_1[LV_HOR_RES_MAX * 4];
|
||||
|
@ -53,9 +50,11 @@ namespace Pinetime {
|
|||
static constexpr uint8_t nbWriteLines = 4;
|
||||
static constexpr uint16_t totalNbLines = 320;
|
||||
static constexpr uint16_t visibleNbLines = 240;
|
||||
|
||||
static constexpr uint8_t MaxScrollOffset() {
|
||||
return LV_VER_RES_MAX - nbWriteLines;
|
||||
}
|
||||
|
||||
FullRefreshDirections scrollDirection = FullRefreshDirections::None;
|
||||
uint16_t writeOffset = 0;
|
||||
uint16_t scrollOffset = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user