diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-12 19:14:00 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-12 19:14:00 +0200 |
commit | e79f744ba8216a67fcaf94228e89719441e6fb7d (patch) | |
tree | e3a75f970c7691f81c70dcbfc490975cfcf0b908 /src/common/src/Core/common.c | |
parent | e20f8816f48aa80a82b241ef73e2d9ab92833f87 (diff) | |
download | glutte-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.c | 7 |
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); +} + |