aboutsummaryrefslogtreecommitdiff
path: root/unittests/hrt.cpp
diff options
context:
space:
mode:
authorDaniel Agar <daniel@agar.ca>2015-03-02 14:32:39 -0500
committerLorenz Meier <lm@inf.ethz.ch>2015-03-19 23:49:35 +0100
commitb55fe24161ef60c7329494ab741263b9b01fe19c (patch)
treedade57dc2b36e5db8be1d53a4db71cc1963ac2ca /unittests/hrt.cpp
parentfb040f91174a5369aa7dd5b272015995ba01acba (diff)
downloadpx4-firmware-b55fe24161ef60c7329494ab741263b9b01fe19c.tar.gz
px4-firmware-b55fe24161ef60c7329494ab741263b9b01fe19c.tar.bz2
px4-firmware-b55fe24161ef60c7329494ab741263b9b01fe19c.zip
unittests fix code style
Diffstat (limited to 'unittests/hrt.cpp')
-rw-r--r--unittests/hrt.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/unittests/hrt.cpp b/unittests/hrt.cpp
index 01b5958b7..d7b4670db 100644
--- a/unittests/hrt.cpp
+++ b/unittests/hrt.cpp
@@ -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;
}