system_time: Use more strict time

This commit is contained in:
Lorenz Meier
2016-04-05 17:10:24 -07:00
parent 805439c0f2
commit 5828c7fa4f
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -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);
}
/*
+3 -2
View File
@@ -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