From bc86783b45fd270ec267e2739b8d0f7868f517a0 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 20 Apr 2019 17:34:23 -0400 Subject: [PATCH] TPS/TPS logging delta TPS not consistent with actual logic fix #768 --- firmware/controllers/algo/accel_enrichment.cpp | 2 +- unit_tests/main.cpp | 2 +- unit_tests/tests/test_accel_enrichment.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index 3cf61ed849..dab57b668d 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -167,7 +167,7 @@ int AccelEnrichmemnt::getMaxDeltaIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE) { float AccelEnrichmemnt::getMaxDelta(DECLARE_ENGINE_PARAMETER_SIGNATURE) { int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_SIGNATURE); - return (cb.get(index) - (cb.get(index - 1))) * CONFIG(specs.cylindersCount); + return (cb.get(index) - (cb.get(index - 1))); } // todo: eliminate code duplication between these two methods! Some pointer magic would help. diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index e379eeb518..8e5519295d 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -46,7 +46,7 @@ GTEST_API_ int main(int argc, char **argv) { // printTriggerDebug = true; // resizeMap(); - printf("Success 20190201\r\n"); + printf("Success 20190420\r\n"); printAllTriggers(); // printConvertedTable(); testing::InitGoogleTest(&argc, argv); diff --git a/unit_tests/tests/test_accel_enrichment.cpp b/unit_tests/tests/test_accel_enrichment.cpp index 087c6fe67f..b3fd235d16 100644 --- a/unit_tests/tests/test_accel_enrichment.cpp +++ b/unit_tests/tests/test_accel_enrichment.cpp @@ -24,14 +24,14 @@ TEST(big, testAccelEnrichment) { engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta"; engine->tpsAccelEnrichment.onNewValue(10 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 40, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#1"; + ASSERT_EQ( 10, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#1"; engine->tpsAccelEnrichment.onNewValue(30 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#2"; + ASSERT_EQ( 20, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#2"; engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#3"; + ASSERT_EQ( 20, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#3"; engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#4"; + ASSERT_EQ( 20, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#4"; engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#5"; engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);