HAL_VRBRAIN: use correct datatype for time conversion

This commit is contained in:
Siddharth Bharat Purohit 2017-06-26 16:08:49 +05:30 committed by Lucas De Marchi
parent d1e0f9733e
commit caf8dce75c

View File

@ -95,8 +95,8 @@ enum VRBRAINUtil::safety_state VRBRAINUtil::safety_switch_state(void)
void VRBRAINUtil::set_system_clock(uint64_t time_utc_usec)
{
timespec ts;
ts.tv_sec = time_utc_usec/1.0e6f;
ts.tv_nsec = (time_utc_usec % 1000000) * 1000;
ts.tv_sec = time_utc_usec/1000000ULL;
ts.tv_nsec = (time_utc_usec % 1000000ULL) * 1000UL;
clock_settime(CLOCK_REALTIME, &ts);
}