Code Review
/
apps
/
low-level-can-service.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
| inline |
side by side
Avoid returning infinity value.
[apps/low-level-can-service.git]
/
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
a35a3e9
..
17c8665
100644
(file)
--- 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()