Display changes
This commit is contained in:
@@ -23,7 +23,7 @@ DisplayController::DisplayController(std::map<std::string, std::shared_ptr<items
|
||||
)
|
||||
: pin_controller{pin_controller}, is_running(true)
|
||||
{
|
||||
for (auto display : displays)
|
||||
for (const auto& display : displays)
|
||||
{
|
||||
this->displays.push_back(std::dynamic_pointer_cast<items::OutputDisplay>(display.second));
|
||||
}
|
||||
@@ -32,8 +32,6 @@ DisplayController::DisplayController(std::map<std::string, std::shared_ptr<items
|
||||
pin_controller->initDisplay(*display);
|
||||
}
|
||||
|
||||
activate_displays();
|
||||
|
||||
this->display_cycle_thread = std::thread(&DisplayController::cycle_displays, this);
|
||||
|
||||
CLOG(DEBUG, OUTPUT_LOGGER) << "Created DisplayController and started cycling them.";
|
||||
@@ -48,9 +46,11 @@ DisplayController::~DisplayController()
|
||||
|
||||
void DisplayController::cycle_displays() const
|
||||
{
|
||||
activate_displays();
|
||||
|
||||
while (is_running)
|
||||
{
|
||||
//std::this_thread::sleep_for(update_frequency);
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(10000));
|
||||
for (auto &display : this->displays)
|
||||
{
|
||||
pin_controller->write_display(*display);
|
||||
|
||||
Reference in New Issue
Block a user