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