mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
system_time: Use more strict time
This commit is contained in:
@@ -133,11 +133,11 @@ int px4_clock_gettime(clockid_t clk_id, struct timespec *tp)
|
||||
/*
|
||||
* Get system time in us
|
||||
*/
|
||||
unsigned long long hrt_system_time(void)
|
||||
uint64_t hrt_system_time(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
px4_clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
return ts_to_abstime(&ts) - px4_timestart;
|
||||
return ts_to_abstime(&ts);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <semaphore.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__PX4_QURT)
|
||||
#include <dspal_types.h>
|
||||
@@ -174,9 +175,9 @@ __EXPORT const char *px4_get_topic_names(unsigned int *handle);
|
||||
/*
|
||||
* The UNIX epoch system time following the system clock
|
||||
*/
|
||||
__EXPORT unsigned long long hrt_system_time(void);
|
||||
__EXPORT uint64_t hrt_system_time(void);
|
||||
|
||||
__EXPORT bool px4_exit_requested(void);
|
||||
__EXPORT bool px4_exit_requested(void);
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
Reference in New Issue
Block a user