lgfx_display: better handle display class construction

이 커밋은 다음에 포함됨:
Florent
2025-10-18 14:03:27 +02:00
부모 45ab0e8cf7
커밋 ce70792309
2개의 변경된 파일4개의 추가작업 그리고 10개의 파일을 삭제
+3 -8
파일 보기
@@ -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 #pragma once
#include <helpers/ui/DisplayDriver.h> #include <helpers/ui/DisplayDriver.h>
@@ -20,11 +14,12 @@ protected:
LGFX_Device* display; LGFX_Device* display;
LGFX_Sprite buffer; LGFX_Sprite buffer;
bool _isOn; bool _isOn = false;
int _color = TFT_WHITE; int _color = TFT_WHITE;
public: 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 begin();
bool isOn() override { return _isOn; } bool isOn() override { return _isOn; }
void turnOn() override; void turnOn() override;
+1 -2
파일 보기
@@ -124,6 +124,5 @@ public:
class SCIndicatorDisplay : public LGFXDisplay { class SCIndicatorDisplay : public LGFXDisplay {
LGFX disp; LGFX disp;
public: public:
SCIndicatorDisplay() : LGFXDisplay(480, 480) SCIndicatorDisplay() : LGFXDisplay(480, 480, disp) {}
{ display=&disp; }
}; };