mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-13 22:00:34 +08:00
GPS driver: Check return value of settime and notify shell if call fails
This commit is contained in:
@@ -826,7 +826,9 @@ UBX::payload_rx_done(void)
|
||||
timespec ts;
|
||||
ts.tv_sec = epoch;
|
||||
ts.tv_nsec = _buf.payload_rx_nav_timeutc.nano;
|
||||
clock_settime(CLOCK_REALTIME, &ts);
|
||||
if (clock_settime(CLOCK_REALTIME, &ts)) {
|
||||
warn("failed setting clock");
|
||||
}
|
||||
|
||||
_gps_position->time_gps_usec = ((uint64_t)epoch) * 1000000ULL;
|
||||
_gps_position->time_gps_usec += _buf.payload_rx_nav_timeutc.nano / 1000;
|
||||
|
||||
Reference in New Issue
Block a user