AP_HAL_PX4: 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:19:30 -03:00 committed by Jacob Walser
parent 3a74ad9105
commit 1ea08c6396
1 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,8 @@ enum PX4Util::safety_state PX4Util::safety_switch_state(void)
void PX4Util::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;