ETB target is using integer values fix #945
This commit is contained in:
parent
e7b658547b
commit
4f33dff0a1
|
@ -832,6 +832,6 @@ int getRusEfiVersion(void) {
|
||||||
if (initBootloader() != 0)
|
if (initBootloader() != 0)
|
||||||
return 123;
|
return 123;
|
||||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||||
return 20190919;
|
return 20190922;
|
||||||
}
|
}
|
||||||
#endif /* EFI_UNIT_TEST */
|
#endif /* EFI_UNIT_TEST */
|
||||||
|
|
|
@ -203,7 +203,7 @@ float interpolate3d(float x, const kType xBin[], int xBinSize, float y, const kT
|
||||||
vType rpmMinKeyMinValue = map[xIndex][yIndex];
|
vType rpmMinKeyMinValue = map[xIndex][yIndex];
|
||||||
vType rpmMaxKeyMinValue = map[xIndex + 1][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 DEBUG_INTERPOLATION
|
||||||
if (needInterpolationLogging()) {
|
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 rpmMinKeyMaxValue = map[xIndex][keyMaxIndex];
|
||||||
vType rpmMaxKeyMaxValue = map[rpmMaxIndex][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 DEBUG_INTERPOLATION
|
||||||
if (needInterpolationLogging()) {
|
if (needInterpolationLogging()) {
|
||||||
|
|
|
@ -196,11 +196,12 @@ TEST(idle, testTargetTpsIsFloatBug945) {
|
||||||
ASSERT_NEAR(50, engine->engineState.targetFromTable, EPS4D);
|
ASSERT_NEAR(50, engine->engineState.targetFromTable, EPS4D);
|
||||||
|
|
||||||
setMockThrottlePedalSensorVoltage(3.05 PASS_ENGINE_PARAMETER_SUFFIX);
|
setMockThrottlePedalSensorVoltage(3.05 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
ASSERT_NEAR(50.8302, getPedalPosition(PASS_ENGINE_PARAMETER_SIGNATURE), EPS4D);
|
||||||
etbController.PeriodicTask();
|
etbController.PeriodicTask();
|
||||||
ASSERT_NEAR(50, engine->engineState.targetFromTable, EPS4D);
|
ASSERT_NEAR(50.8302, engine->engineState.targetFromTable, EPS4D);
|
||||||
|
|
||||||
setMockThrottlePedalSensorVoltage(3.1 PASS_ENGINE_PARAMETER_SUFFIX);
|
setMockThrottlePedalSensorVoltage(3.1 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
etbController.PeriodicTask();
|
etbController.PeriodicTask();
|
||||||
ASSERT_NEAR(51, engine->engineState.targetFromTable, EPS4D);
|
ASSERT_NEAR(51.6605, engine->engineState.targetFromTable, EPS4D);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue