diff --git a/src/platforms/posix/px4_layer/drv_hrt.c b/src/platforms/posix/px4_layer/drv_hrt.c index d40b540b2c5..7c4b39af67e 100644 --- a/src/platforms/posix/px4_layer/drv_hrt.c +++ b/src/platforms/posix/px4_layer/drv_hrt.c @@ -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); } /* diff --git a/src/platforms/px4_posix.h b/src/platforms/px4_posix.h index e1b9f3c149d..7a92bf7acf7 100644 --- a/src/platforms/px4_posix.h +++ b/src/platforms/px4_posix.h @@ -45,6 +45,7 @@ #include #include #include +#include #if defined(__PX4_QURT) #include @@ -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