From 8fd879fb7bb9ed34fe69581dc714b4158046519f Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 30 Oct 2018 19:49:29 -0700 Subject: Remove timer in favor of sdeventplus/utility/timer This removes the custom timer implementation and moves to the sdeventplus utility. Functionally this should make no change Tested: Built and run through the unit test suite. Change-Id: Ib7ee90d489d5db72496aaaca91c3cf5490ad47d6 Signed-off-by: William A. Kennington III --- monitor/tach_sensor.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'monitor/tach_sensor.cpp') diff --git a/monitor/tach_sensor.cpp b/monitor/tach_sensor.cpp index 26ba3c9..5494450 100644 --- a/monitor/tach_sensor.cpp +++ b/monitor/tach_sensor.cpp @@ -221,24 +221,11 @@ void TachSensor::handleTachChange(sdbusplus::message::message& msg) void TachSensor::startTimer(TimerMode mode) { - if (!timerRunning()) + if (!timerRunning() || mode != _timerMode) { - _timer.start( - getDelay(mode), - util::Timer::TimerType::oneshot); + _timer.restartOnce(getDelay(mode)); _timerMode = mode; } - else - { - if (mode != _timerMode) - { - _timer.stop(); - _timer.start( - getDelay(mode), - util::Timer::TimerType::oneshot); - _timerMode = mode; - } - } } std::chrono::microseconds TachSensor::getDelay(TimerMode mode) -- cgit v1.2.1