Fixed array out of bounds issue - not all set.

This commit is contained in:
blckmn 2016-06-26 08:59:32 +10:00
parent 00c0ca7c71
commit d779daad2d
1 changed files with 7 additions and 7 deletions

View File

@ -161,13 +161,13 @@ void gyroUpdate(void)
if (gyroLpfCutFreq) {
if (!gyroFilterStateIsSet) initGyroFilterCoefficients(); /* initialise filter coefficients */
if (gyroFilterStateIsSet) {
for (axis = 0; axis < XYZ_AXIS_COUNT; axis++) {
if (gyroFilterStateIsSet) {
gyroADCf[axis] = applyBiQuadFilter((float) gyroADC[axis], &gyroFilterState[axis]);
gyroADC[axis] = lrintf(gyroADCf[axis]);
}
} else {
gyroADCf[axis] = gyroADC[axis]; // Otherwise float pid controller will not have gyro input when filter disabled
}
}
}
}