unittests fix code style

This commit is contained in:
Daniel Agar
2015-03-19 23:49:35 +01:00
committed by Lorenz Meier
parent fb040f9117
commit b55fe24161
10 changed files with 71 additions and 55 deletions
+9 -7
View File
@@ -3,14 +3,16 @@
#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_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) {
hrt_abstime hrt_elapsed_time(const volatile hrt_abstime *then)
{
// not thread safe
return hrt_absolute_time() - *then;
return hrt_absolute_time() - *then;
}