Code Review
/
apps
/
agl-service-can-low-level.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix: wrong calculation doesn't match method name.
[apps/agl-service-can-low-level.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
7edb0d5
..
5c659ca
100644
(file)
--- a/
CAN-binder/low-can-binding/utils/timer.cpp
+++ b/
CAN-binder/low-can-binding/utils/timer.cpp
@@
-66,14
+66,14
@@
frequency_clock_t::frequency_clock_t(float frequency)
/// @param[in] frequency - Frequency to convert, in hertz
float frequency_clock_t::frequency_to_period()
{
/// @param[in] frequency - Frequency to convert, in hertz
float frequency_clock_t::frequency_to_period()
{
- return frequency_ == 0 ? 0 : 1 / frequency_
* unit_
;
+ return frequency_ == 0 ? 0 : 1 / frequency_;
}
const struct timeval frequency_clock_t::get_timeval_from_period() const
{
struct timeval freq = {0, 0};
float f;
}
const struct timeval frequency_clock_t::get_timeval_from_period() const
{
struct timeval freq = {0, 0};
float f;
- freq.tv_usec = (long int)
std::modf(frequency_, &f
);
+ freq.tv_usec = (long int)
(std::modf(frequency_to_period(), &f) * unit_
);
freq.tv_sec = (time_t)f;
return freq;
freq.tv_sec = (time_t)f;
return freq;