aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/src/Core/common.c
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-12 19:14:00 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-12 19:14:00 +0200
commite79f744ba8216a67fcaf94228e89719441e6fb7d (patch)
treee3a75f970c7691f81c70dcbfc490975cfcf0b908 /src/common/src/Core/common.c
parente20f8816f48aa80a82b241ef73e2d9ab92833f87 (diff)
downloadglutte-o-matic-e79f744ba8216a67fcaf94228e89719441e6fb7d.tar.gz
glutte-o-matic-e79f744ba8216a67fcaf94228e89719441e6fb7d.tar.bz2
glutte-o-matic-e79f744ba8216a67fcaf94228e89719441e6fb7d.zip
Transmit voltage and temperature in beacons
Diffstat (limited to 'src/common/src/Core/common.c')
-rw-r--r--src/common/src/Core/common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/src/Core/common.c b/src/common/src/Core/common.c
index d231569..dc41f98 100644
--- a/src/common/src/Core/common.c
+++ b/src/common/src/Core/common.c
@@ -28,7 +28,7 @@
#include "timers.h"
#include "GPS/gps.h"
#include <time.h>
-
+#include <math.h>
static uint64_t common_timestamp = 0; // milliseconds since startup
static TimerHandle_t common_timer;
@@ -211,3 +211,8 @@ void trigger_fault(int source)
while (1) {}
}
+float round_float_to_half_steps(float value)
+{
+ return 0.5f * roundf(value * 2.0f);
+}
+