Correct conversion from sec to usec

This commit is contained in:
Kjersti Brynestad 2021-08-18 15:59:44 +02:00 committed by Nuno Marques
parent 04adf6c9be
commit 62aa9c9f34
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ MavlinkTimesync::handle_message(const mavlink_message_t *msg)
// date -d @1234567890: Sat Feb 14 02:31:30 MSK 2009 // date -d @1234567890: Sat Feb 14 02:31:30 MSK 2009
bool onb_unix_valid = (unsigned long long)tv.tv_sec > PX4_EPOCH_SECS; bool onb_unix_valid = (unsigned long long)tv.tv_sec > PX4_EPOCH_SECS;
bool ofb_unix_valid = time.time_unix_usec > PX4_EPOCH_SECS * 1000ULL; bool ofb_unix_valid = time.time_unix_usec > PX4_EPOCH_SECS * 1000000ULL;
if (!onb_unix_valid && ofb_unix_valid) { if (!onb_unix_valid && ofb_unix_valid) {
tv.tv_sec = time.time_unix_usec / 1000000ULL; tv.tv_sec = time.time_unix_usec / 1000000ULL;