ETB target is using integer values fix #945

This commit is contained in:
rusefi 2019-09-22 18:15:00 -04:00
parent e7b658547b
commit 4f33dff0a1
3 changed files with 6 additions and 5 deletions

View File

@ -832,6 +832,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20190919;
return 20190922;
}
#endif /* EFI_UNIT_TEST */

View File

@ -203,7 +203,7 @@ float interpolate3d(float x, const kType xBin[], int xBinSize, float y, const kT
vType rpmMinKeyMinValue = map[xIndex][yIndex];
vType rpmMaxKeyMinValue = map[xIndex + 1][yIndex];
vType keyMinValue = interpolateMsg("", xMin, rpmMinKeyMinValue, xMax, rpmMaxKeyMinValue, x);
float keyMinValue = interpolateMsg("", xMin, rpmMinKeyMinValue, xMax, rpmMaxKeyMinValue, x);
#if DEBUG_INTERPOLATION
if (needInterpolationLogging()) {
@ -218,7 +218,7 @@ float interpolate3d(float x, const kType xBin[], int xBinSize, float y, const kT
vType rpmMinKeyMaxValue = map[xIndex][keyMaxIndex];
vType rpmMaxKeyMaxValue = map[rpmMaxIndex][keyMaxIndex];
vType keyMaxValue = interpolateMsg("3d", xMin, rpmMinKeyMaxValue, xMax, rpmMaxKeyMaxValue, x);
float keyMaxValue = interpolateMsg("3d", xMin, rpmMinKeyMaxValue, xMax, rpmMaxKeyMaxValue, x);
#if DEBUG_INTERPOLATION
if (needInterpolationLogging()) {

View File

@ -196,11 +196,12 @@ TEST(idle, testTargetTpsIsFloatBug945) {
ASSERT_NEAR(50, engine->engineState.targetFromTable, EPS4D);
setMockThrottlePedalSensorVoltage(3.05 PASS_ENGINE_PARAMETER_SUFFIX);
ASSERT_NEAR(50.8302, getPedalPosition(PASS_ENGINE_PARAMETER_SIGNATURE), EPS4D);
etbController.PeriodicTask();
ASSERT_NEAR(50, engine->engineState.targetFromTable, EPS4D);
ASSERT_NEAR(50.8302, engine->engineState.targetFromTable, EPS4D);
setMockThrottlePedalSensorVoltage(3.1 PASS_ENGINE_PARAMETER_SUFFIX);
etbController.PeriodicTask();
ASSERT_NEAR(51, engine->engineState.targetFromTable, EPS4D);
ASSERT_NEAR(51.6605, engine->engineState.targetFromTable, EPS4D);
}