move display abstract to first parameter of hardware

abstract and no longer provide a default for it.
This commit is contained in:
Matthew Colvin 2023-08-14 12:57:09 -05:00 committed by MatthewColvin
parent 509d71cdaa
commit b182f0b75d
4 changed files with 15 additions and 15 deletions

View file

@ -1,9 +1,9 @@
#include "HardwareAbstract.hpp"
HardwareAbstract::HardwareAbstract(
std::shared_ptr<DisplayAbstract> aDisplay,
std::shared_ptr<BatteryInterface> aBattery,
std::shared_ptr<wifiHandlerInterface> aWifiHandler,
std::shared_ptr<DisplayAbstract> aDisplay
std::shared_ptr<wifiHandlerInterface> aWifiHandler
)
: mBattery(std::move(aBattery)),
mWifiHandler(std::move(aWifiHandler)),

View file

@ -15,9 +15,10 @@
class HardwareAbstract {
public:
HardwareAbstract(std::shared_ptr<BatteryInterface> aBattery = nullptr,
std::shared_ptr<wifiHandlerInterface> aWifiHandler = nullptr,
std::shared_ptr<DisplayAbstract> aDisplay = nullptr
HardwareAbstract(
std::shared_ptr<DisplayAbstract> aDisplay,
std::shared_ptr<BatteryInterface> aBattery = nullptr,
std::shared_ptr<wifiHandlerInterface> aWifiHandler = nullptr
);
struct batteryStatus {
@ -49,5 +50,4 @@ public:
std::shared_ptr<wifiHandlerInterface> mWifiHandler;
std::shared_ptr<DisplayAbstract> mDisplay;
};

View file

@ -53,9 +53,9 @@ void HardwareRevX::initIO() {
HardwareRevX::HardwareRevX():
HardwareAbstract(
Display::getInstance(standbyTimer),
std::make_shared<Battery>(ADC_BAT,CRG_STAT),
wifiHandler::getInstance(),
Display::getInstance(standbyTimer)
wifiHandler::getInstance()
){}
HardwareRevX::WakeReason getWakeReason() {

View file

@ -5,7 +5,7 @@
class HardwareSimulator : public HardwareAbstract {
public:
HardwareSimulator() : HardwareAbstract(nullptr){};
HardwareSimulator() : HardwareAbstract(){};
virtual void debugPrint(std::string message) override {
std::cout << message;