2021-01-19 22:12:55 +00:00
|
|
|
#include <logger.h>
|
|
|
|
#include <TimeLib.h>
|
2021-02-10 21:37:18 +00:00
|
|
|
#include "project_configuration.h"
|
2021-01-19 22:12:55 +00:00
|
|
|
#include "TaskDisplay.h"
|
|
|
|
|
|
|
|
DisplayTask::DisplayTask()
|
2021-01-30 21:47:24 +00:00
|
|
|
: Task("DisplayTask", 0)
|
2021-01-19 22:12:55 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
DisplayTask::~DisplayTask()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DisplayTask::setup(std::shared_ptr<Configuration> config, std::shared_ptr<BoardConfig> boardConfig)
|
|
|
|
{
|
|
|
|
Display::instance().setup(boardConfig);
|
2021-02-10 21:37:18 +00:00
|
|
|
if(config->display.turn180)
|
|
|
|
{
|
|
|
|
Display::instance().turn180();
|
|
|
|
}
|
2021-01-30 21:47:24 +00:00
|
|
|
std::shared_ptr<StatusFrame> statusFrame = std::shared_ptr<StatusFrame>(new StatusFrame(TaskManager::instance().getTasks()));
|
|
|
|
Display::instance().setStatusFrame(statusFrame);
|
2021-02-11 21:07:17 +00:00
|
|
|
_stateInfo = config->callsign;
|
2021-01-19 22:12:55 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DisplayTask::loop(std::shared_ptr<Configuration> config)
|
|
|
|
{
|
|
|
|
Display::instance().update();
|
|
|
|
return true;
|
|
|
|
}
|