Merged beta into mavlink rework branch

This commit is contained in:
Lorenz Meier
2014-01-28 15:13:14 +01:00
parent ac77fe9c27
commit 9c355d280e
220 changed files with 10717 additions and 9729 deletions
+16
View File
@@ -0,0 +1,16 @@
#include <sys/time.h>
#include <inttypes.h>
#include <drivers/drv_hrt.h>
#include <stdio.h>
hrt_abstime hrt_absolute_time() {
struct timeval te;
gettimeofday(&te, NULL); // get current time
hrt_abstime us = static_cast<uint64_t>(te.tv_sec) * 1e6 + te.tv_usec; // caculate us
return us;
}
hrt_abstime hrt_elapsed_time(const volatile hrt_abstime *then) {
// not thread safe
return hrt_absolute_time() - *then;
}