Closed FigueiredoStable closed 2 weeks ago
both ::init()
methods are identical; since LGFX has a desing pattern for display variants, let's create a Panel_ST7701_Base
to handle the redundant ::init()
and make both Panel_ST7701
and Panel_ST7701_guition_esp32_4848S040
inherit from it:
struct Panel_ST7701_Base : public Panel_RGB
{
bool init(bool) override;
};
struct Panel_ST7701 : public Panel_ST7701_Base
{
protected:
const uint8_t* getInitCommands(uint8_t listno) const override;
};
struct Panel_ST7701_guition_esp32_4848S040: public Panel_ST7701_Base
{
protected:
const uint8_t* getInitCommands(uint8_t listno) const override;
};
Panel_ST7701_Base::init(bool)
Panel_ST7701::init(bool)
Panel_ST7701_guition_esp32_4848S040::init(bool)
both
::init()
methods are identical; since LGFX has a desing pattern for display variants, let's create aPanel_ST7701_Base
to handle the redundant::init()
and make bothPanel_ST7701
andPanel_ST7701_guition_esp32_4848S040
inherit from it:lgfx/v1/platforms/esp32s3/Panel_RGB.hpp
struct Panel_ST7701_Base : public Panel_RGB { bool init(bool) override; }; struct Panel_ST7701 : public Panel_ST7701_Base { protected: const uint8_t* getInitCommands(uint8_t listno) const override; }; struct Panel_ST7701_guition_esp32_4848S040: public Panel_ST7701_Base { protected: const uint8_t* getInitCommands(uint8_t listno) const override; };
lgfx/v1/platforms/esp32s3/Panel_RGB.cpp
- create
Panel_ST7701_Base::init(bool)
- remove
Panel_ST7701::init(bool)
- remove
Panel_ST7701_guition_esp32_4848S040::init(bool)
Great point, i added Panel ST7701 base initialization. Tks
looks good, thanks for your contribution :+1:
Just add a new device support for ST7701 manufactured by GUITION, link: GUITION Smart Display
* The board:
* Before the new instructions, colors were inverted or only rendered a partial size of the screen:
* After added instructions by manufacture