From 4872af1053c07c536d6f83646586564cbddae49c Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Mon, 31 Jul 2023 03:53:13 +0200 Subject: [PATCH] control: use new refresh task control. --- devices/video/control.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/devices/video/control.cpp b/devices/video/control.cpp index ee257d8..3f6a196 100644 --- a/devices/video/control.cpp +++ b/devices/video/control.cpp @@ -31,7 +31,6 @@ along with this program. If not, see . Kudos to joevt#3510 for his precious technical help and HW hacking. */ -#include #include #include #include @@ -293,18 +292,10 @@ void ControlVideo::enable_display() / (new_height + vert_blank); LOG_F(INFO, "Control: refresh rate set to %f Hz", this->refresh_rate); - if (this->refresh_task_id) { - TimerManager::get_instance()->cancel_timer(this->refresh_task_id); - } + this->stop_refresh_task(); // set up periodic timer for display updates - uint64_t refresh_interval = static_cast(1.0f / refresh_rate * NS_PER_SEC + 0.5); - this->refresh_task_id = TimerManager::get_instance()->add_cyclic_timer( - refresh_interval, - [this]() { - this->update_screen(); - } - ); + this->start_refresh_task(); this->blank_on = false;