auto-sync

This commit is contained in:
rusEfi 2015-03-18 21:05:22 -05:00
parent 032a12edca
commit 961716d6c2
1 changed files with 15 additions and 9 deletions

View File

@ -235,8 +235,14 @@ float interpolate3d(float x, float xBin[], int xBinSize, float y, float yBin[],
if (needInterpolationLogging)
printf("X is smaller than smallest cell in table: %dr\n", xIndex);
#endif
// no interpolation should be fine here.
if (yIndex == yBinSize - 1)
return map[0][yIndex];
float keyMin = yBin[yIndex];
float keyMax = yBin[yIndex + 1];
float rpmMinValue = map[0][yIndex];
float rpmMaxValue = map[0][yIndex + 1];
return interpolate(keyMin, rpmMinValue, keyMax, rpmMaxValue, y);
}
if (yIndex < 0) {