diff --git a/Platformio/HAL/DisplayInterface.cpp b/Platformio/HAL/DisplayInterface.cpp index 572ec63..7a61398 100644 --- a/Platformio/HAL/DisplayInterface.cpp +++ b/Platformio/HAL/DisplayInterface.cpp @@ -1,8 +1,8 @@ #include "DisplayInterface.h" -std::shared_ptr DisplayInterface::mInstance = nullptr; +std::shared_ptr DisplayAbstract::mInstance = nullptr; -DisplayInterface::DisplayInterface(){ +DisplayAbstract::DisplayAbstract(){ lv_init(); lv_disp_draw_buf_init(&mdraw_buf, mbufA, mbufB, @@ -13,7 +13,7 @@ DisplayInterface::DisplayInterface(){ lv_disp_drv_init(&disp_drv); disp_drv.hor_res = SCREEN_WIDTH; disp_drv.ver_res = SCREEN_HEIGHT; - disp_drv.flush_cb = &DisplayInterface::flushDisplayImpl; + disp_drv.flush_cb = &DisplayAbstract::flushDisplayImpl; disp_drv.draw_buf = &mdraw_buf; lv_disp_drv_register(&disp_drv); @@ -21,15 +21,15 @@ DisplayInterface::DisplayInterface(){ static lv_indev_drv_t indev_drv; lv_indev_drv_init(&indev_drv); indev_drv.type = LV_INDEV_TYPE_POINTER; - indev_drv.read_cb = &DisplayInterface::screenInputImpl; + indev_drv.read_cb = &DisplayAbstract::screenInputImpl; lv_indev_drv_register(&indev_drv); } -void DisplayInterface::flushDisplayImpl(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) { +void DisplayAbstract::flushDisplayImpl(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) { mInstance->flushDisplay(disp, area, color_p); } -void DisplayInterface::screenInputImpl(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) { +void DisplayAbstract::screenInputImpl(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) { mInstance->screenInput(indev_driver, data); } \ No newline at end of file diff --git a/Platformio/HAL/HardwareAbstract.cpp b/Platformio/HAL/HardwareAbstract.cpp index 91f1e89..b6d70a8 100644 --- a/Platformio/HAL/HardwareAbstract.cpp +++ b/Platformio/HAL/HardwareAbstract.cpp @@ -3,7 +3,7 @@ HardwareAbstract::HardwareAbstract( std::shared_ptr aBattery, std::shared_ptr aWifiHandler, - std::shared_ptr aDisplay + std::shared_ptr aDisplay ) : mBattery(std::move(aBattery)), mWifiHandler(std::move(aWifiHandler)), diff --git a/Platformio/HAL/HardwareAbstract.hpp b/Platformio/HAL/HardwareAbstract.hpp index 8b62800..1c3690f 100644 --- a/Platformio/HAL/HardwareAbstract.hpp +++ b/Platformio/HAL/HardwareAbstract.hpp @@ -17,7 +17,7 @@ class HardwareAbstract { public: HardwareAbstract(std::shared_ptr aBattery = nullptr, std::shared_ptr aWifiHandler = nullptr, - std::shared_ptr aDisplay = nullptr + std::shared_ptr aDisplay = nullptr ); struct batteryStatus { @@ -47,7 +47,7 @@ public: private: std::shared_ptr mBattery; std::shared_ptr mWifiHandler; - std::shared_ptr mDisplay; + std::shared_ptr mDisplay; }; diff --git a/Platformio/HAL/HardwareInterfaces/DisplayInterface.h b/Platformio/HAL/HardwareInterfaces/DisplayInterface.h index 62e3a5b..7974829 100644 --- a/Platformio/HAL/HardwareInterfaces/DisplayInterface.h +++ b/Platformio/HAL/HardwareInterfaces/DisplayInterface.h @@ -1,16 +1,16 @@ #pragma once #include #include "lvgl.h" -class DisplayInterface +class DisplayAbstract { public: - DisplayInterface(); + DisplayAbstract(); virtual void setBrightness(uint8_t brightness) = 0; virtual void turnOff() = 0; protected: // Set this with a getInstance method in the Child Class - static std::shared_ptr mInstance; + static std::shared_ptr mInstance; virtual void flushDisplay(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) = 0; virtual void screenInput(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) = 0; diff --git a/Platformio/HAL/Targets/ESP32/display/display.cpp b/Platformio/HAL/Targets/ESP32/display/display.cpp index e9566c3..ef84b0e 100644 --- a/Platformio/HAL/Targets/ESP32/display/display.cpp +++ b/Platformio/HAL/Targets/ESP32/display/display.cpp @@ -5,14 +5,14 @@ std::shared_ptr Display::getInstance(int& standby_timer) { - if (DisplayInterface::mInstance == nullptr) + if (DisplayAbstract::mInstance == nullptr) { - DisplayInterface::mInstance = std::shared_ptr(new Display(LCD_EN, LCD_BL, standby_timer)); + DisplayAbstract::mInstance = std::shared_ptr(new Display(LCD_EN, LCD_BL, standby_timer)); } return std::static_pointer_cast(mInstance); } -Display::Display(int backlight_pin, int enable_pin, int& standby_timer): DisplayInterface(), +Display::Display(int backlight_pin, int enable_pin, int& standby_timer): DisplayAbstract(), mBacklightPin(backlight_pin), mEnablePin(enable_pin), tft(TFT_eSPI()), diff --git a/Platformio/HAL/Targets/ESP32/display/display.hpp b/Platformio/HAL/Targets/ESP32/display/display.hpp index 2e9e0b2..b02f5f3 100644 --- a/Platformio/HAL/Targets/ESP32/display/display.hpp +++ b/Platformio/HAL/Targets/ESP32/display/display.hpp @@ -15,7 +15,7 @@ #define DEFAULT_BACKLIGHT_BRIGHTNESS 128 -class Display: public DisplayInterface +class Display: public DisplayAbstract { public: static std::shared_ptr getInstance(int& standby_timer);