P_HAL_VRBRAIN: Add system_time_was_set to set system_time once

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2018-04-19 13:20:40 -03:00 committed by Jacob Walser
parent 1ea08c6396
commit 72234031c0
1 changed files with 2 additions and 0 deletions

View File

@ -94,6 +94,8 @@ enum VRBRAINUtil::safety_state VRBRAINUtil::safety_switch_state(void)
void VRBRAINUtil::set_system_clock(uint64_t time_utc_usec)
{
_system_time_was_set = true;
timespec ts;
ts.tv_sec = time_utc_usec/1.0e6f;
ts.tv_nsec = (time_utc_usec % 1000000) * 1000;