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:
parent
6d7bfb9b1e
commit
4891a55a53
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue