1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

maybe more efficient?

This commit is contained in:
ctzsnooze 2020-09-13 12:11:09 +10:00
parent 73663f7fae
commit 0833aab886

View file

@ -102,6 +102,7 @@ FAST_CODE_NOINLINE float interpolatedSpApply(int axis, bool newRcFrame, ffInterp
} }
} else { } else {
// we have movement; let's consider what happened on previous packets, using ffStatus // we have movement; let's consider what happened on previous packets, using ffStatus
if (ffStatus[axis] != 0) {
if (ffStatus[axis] == 1) { if (ffStatus[axis] == 1) {
// was interpolated forward after previous dropped packet after small step // was interpolated forward after previous dropped packet after small step
// this step is likely twice as tall as it should be // this step is likely twice as tall as it should be
@ -116,6 +117,7 @@ FAST_CODE_NOINLINE float interpolatedSpApply(int axis, bool newRcFrame, ffInterp
ffStatus[axis] = 0; ffStatus[axis] = 0;
// all is normal // all is normal
} }
}
float setpointAcceleration = setpointSpeed - prevSetpointSpeed[axis]; float setpointAcceleration = setpointSpeed - prevSetpointSpeed[axis];