From 732e212fd2e9c8a69c1ce692fe55af6a8d04f777 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 16 May 2017 12:48:10 +0200 Subject: [PATCH] Better suited method. Change-Id: I287e445c6f1c372a852752911d032a70654aa082 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/utils/timer.cpp | 2 +- CAN-binder/low-can-binding/utils/timer.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CAN-binder/low-can-binding/utils/timer.cpp b/CAN-binder/low-can-binding/utils/timer.cpp index 5c659ca..a7ed558 100644 --- a/CAN-binder/low-can-binding/utils/timer.cpp +++ b/CAN-binder/low-can-binding/utils/timer.cpp @@ -64,7 +64,7 @@ frequency_clock_t::frequency_clock_t(float frequency) /// @brief Return the period in ms given the frequency in hertz. /// @param[in] frequency - Frequency to convert, in hertz -float frequency_clock_t::frequency_to_period() +float frequency_clock_t::frequency_to_period() const { return frequency_ == 0 ? 0 : 1 / frequency_; } diff --git a/CAN-binder/low-can-binding/utils/timer.hpp b/CAN-binder/low-can-binding/utils/timer.hpp index d3fedbd..8ea7476 100644 --- a/CAN-binder/low-can-binding/utils/timer.hpp +++ b/CAN-binder/low-can-binding/utils/timer.hpp @@ -47,7 +47,7 @@ public: float get_frequency() const; const struct timeval get_timeval_from_period() const; - float frequency_to_period(); + float frequency_to_period() const; bool started(); time_function_t get_time_function(); bool elapsed(bool stagger); -- 2.16.6