mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
lgfx_display: better handle display class construction
This commit is contained in:
parent
45ab0e8cf7
commit
ce70792309
2 changed files with 4 additions and 10 deletions
|
|
@ -1,9 +1,3 @@
|
|||
|
||||
/*
|
||||
* Base class for LovyanGFX supported display (works on ESP32 mainly)
|
||||
* You can extend this class to support your display, providing your own LGFX
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <helpers/ui/DisplayDriver.h>
|
||||
|
|
@ -20,11 +14,12 @@ protected:
|
|||
LGFX_Device* display;
|
||||
LGFX_Sprite buffer;
|
||||
|
||||
bool _isOn;
|
||||
bool _isOn = false;
|
||||
int _color = TFT_WHITE;
|
||||
|
||||
public:
|
||||
LGFXDisplay(int w, int h):DisplayDriver(w/UI_ZOOM, h/UI_ZOOM) {_isOn = false;}
|
||||
LGFXDisplay(int w, int h, LGFX_Device &disp)
|
||||
: DisplayDriver(w/UI_ZOOM, h/UI_ZOOM), display(&disp) {}
|
||||
bool begin();
|
||||
bool isOn() override { return _isOn; }
|
||||
void turnOn() override;
|
||||
|
|
|
|||
|
|
@ -124,6 +124,5 @@ public:
|
|||
class SCIndicatorDisplay : public LGFXDisplay {
|
||||
LGFX disp;
|
||||
public:
|
||||
SCIndicatorDisplay() : LGFXDisplay(480, 480)
|
||||
{ display=&disp; }
|
||||
SCIndicatorDisplay() : LGFXDisplay(480, 480, disp) {}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue