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