From 4891a55a538346572c459c64d8a7abd088ea732a Mon Sep 17 00:00:00 2001 From: tbolin Date: Mon, 13 Nov 2023 11:42:14 +0100 Subject: [PATCH] Remove back-and-forth float to int to float conversion in acceleration calculation (#13158) Remove float to int to float conversion in acceleration calculation --- src/main/sensors/acceleration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/sensors/acceleration.c b/src/main/sensors/acceleration.c index 1ee9cc9149e..7c376395c0f 100644 --- a/src/main/sensors/acceleration.c +++ b/src/main/sensors/acceleration.c @@ -79,7 +79,7 @@ void accUpdate(timeUs_t currentTimeUs) applyAccelerationTrims(accelerationRuntime.accelerationTrims); for (int axis = 0; axis < XYZ_AXIS_COUNT; axis++) { - const int16_t val = acc.accADC[axis]; + const float val = acc.accADC[axis]; acc.accADC[axis] = accelerationRuntime.accLpfCutHz ? pt2FilterApply(&accelerationRuntime.accFilter[axis], val) : val; } }