OMOTE/Platformio/HAL/Targets/Simulator/HardwareSimulator.hpp
Matthew Colvin 65162049b3 convert notification driven battery to lvgl timer based polling
using new poller class to simplify the battery interface and
downstream usages of battery.

tweaked poller destructor and remove the default constructor
in preference of using a unique pointer

convert simulator to use a std::thread for lvgl Tick api because
the SDL thread sleep was not true to time. (and is simplified the code...)
2023-09-09 21:47:36 -04:00

33 lines
816 B
C++

#pragma once
#include "HardwareAbstract.hpp"
#include "batterySimulator.hpp"
#include "SDLDisplay.hpp"
#include "wifiHandlerSim.hpp"
#include <thread>
class HardwareSimulator : public HardwareAbstract {
public:
HardwareSimulator();
virtual void init() override {};
virtual void debugPrint(const char* fmt, ...) override {
va_list arguments;
va_start(arguments, fmt);
vprintf(fmt, arguments);
va_end(arguments);
}
virtual std::shared_ptr<BatteryInterface> battery() override;
virtual std::shared_ptr<DisplayAbstract> display() override;
virtual std::shared_ptr<wifiHandlerInterface> wifi() override;
private:
std::thread mTickThread;
std::shared_ptr<BatterySimulator> mBattery;
std::shared_ptr<SDLDisplay> mDisplay;
std::shared_ptr<wifiHandlerSim> mWifiHandler;
};