1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Remove back-and-forth float to int to float conversion in acceleration calculation (#13158)

Remove float to int to float conversion in acceleration calculation
This commit is contained in:
tbolin 2023-11-13 11:42:14 +01:00 committed by GitHub
parent 6d7bfb9b1e
commit 4891a55a53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}