From 36c35345fa3ba4eb7c7652caae6eecb44ba37770 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 6 Oct 2019 07:03:34 +0300 Subject: libcamera: timer: Don't reset deadline after time out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users of the Timer class may benefit from retrieving the timer deadline after it times out. This is currently not possible as the deadline is reset to 0 when the timer times out or is stopped. Fix this by not resetting the deadline, and adding a new running_ field to the Timer class to implement isRunning(). Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- include/libcamera/timer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/libcamera/timer.h b/include/libcamera/timer.h index 09f426a5..3540efb4 100644 --- a/include/libcamera/timer.h +++ b/include/libcamera/timer.h @@ -39,6 +39,7 @@ private: void registerTimer(); void unregisterTimer(); + bool running_; std::chrono::steady_clock::time_point deadline_; }; -- cgit v1.2.1