aboutsummaryrefslogtreecommitdiff
path: root/Tools/tests-host/hrt.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-12-31 14:45:38 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-12-31 14:45:38 +0100
commit7f14f1f7deb945b7f0ba14c2f49758e9a79d12a3 (patch)
tree85224dcdd724e6a59129cbdbe67a246b432172e2 /Tools/tests-host/hrt.cpp
parentc367959d28134fb6c937af83a3e2dcc25b411eee (diff)
downloadpx4-firmware-7f14f1f7deb945b7f0ba14c2f49758e9a79d12a3.tar.gz
px4-firmware-7f14f1f7deb945b7f0ba14c2f49758e9a79d12a3.tar.bz2
px4-firmware-7f14f1f7deb945b7f0ba14c2f49758e9a79d12a3.zip
Add conversions and mixer tests. Work in progress
Diffstat (limited to 'Tools/tests-host/hrt.cpp')
-rw-r--r--Tools/tests-host/hrt.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Tools/tests-host/hrt.cpp b/Tools/tests-host/hrt.cpp
new file mode 100644
index 000000000..dc9fa23de
--- /dev/null
+++ b/Tools/tests-host/hrt.cpp
@@ -0,0 +1,13 @@
+#include <sys/time.h>
+#include <inttypes.h>
+#include <drivers/drv_hrt.h>
+#include <stdio.h>
+
+uint64_t hrt_absolute_time()
+{
+ struct timeval te;
+ gettimeofday(&te, NULL); // get current time
+ unsigned long long us = static_cast<uint64_t>(te.tv_sec) * 1e6 + te.tv_usec; // caculate us
+ printf("us: %lld\n", us);
+ return us;
+} \ No newline at end of file