aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/src/Core/common.c
diff options
context:
space:
mode:
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);
+}
+