From fa5efb55fb570b33a842917565592df04d400e94 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 5 May 2017 18:39:32 +0200 Subject: Avoid returning infinity value. Change-Id: I89d227e48add0c7fc8a4ca577023995b269e6f13 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/utils/timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CAN-binder/low-can-binding/utils/timer.cpp') diff --git a/CAN-binder/low-can-binding/utils/timer.cpp b/CAN-binder/low-can-binding/utils/timer.cpp index a35a3e9f..17c86659 100644 --- a/CAN-binder/low-can-binding/utils/timer.cpp +++ b/CAN-binder/low-can-binding/utils/timer.cpp @@ -63,7 +63,7 @@ frequency_clock_t::frequency_clock_t(float frequency) /// @param[in] frequency - Frequency to convert, in hertz float frequency_clock_t::frequency_to_period() { - return 1 / frequency_ * unit_; + return frequency_ == 0 ? 0 : 1 / frequency_ * unit_; } bool frequency_clock_t::started() -- cgit 1.2.3-korg