From 57e62ef8a0094e15fbc1d20dfdd761702d8c6918 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 26 Sep 2023 15:19:46 -0400 Subject: [PATCH] changing TPS/TPS defaults --- .../controllers/algo/defaults/default_fuel.cpp | 17 ++++++++--------- unit_tests/tests/test_accel_enrichment.cpp | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/firmware/controllers/algo/defaults/default_fuel.cpp b/firmware/controllers/algo/defaults/default_fuel.cpp index 02c44cb787..4a9ea1d414 100644 --- a/firmware/controllers/algo/defaults/default_fuel.cpp +++ b/firmware/controllers/algo/defaults/default_fuel.cpp @@ -136,15 +136,14 @@ static void setDefaultStftSettings() { } static const uint8_t tpsTpsTable[TPS_TPS_ACCEL_TABLE][TPS_TPS_ACCEL_TABLE] = { -/* Generated by TS2C on Tue Apr 18 21:29:16 EDT 2017*/ -{/* 0 0 *//* 0 0.0*/0, /* 1 10.0*/0, /* 2 20.0*/0, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, }, -{/* 1 10 *//* 0 0.0*/10, /* 1 10.0*/0, /* 2 20.0*/0, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, }, -{/* 2 20 *//* 0 0.0*/17, /* 1 10.0*/10, /* 2 20.0*/0, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, }, -{/* 3 35 *//* 0 0.0*/23, /* 1 10.0*/17, /* 2 20.0*/10, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, }, -{/* 4 50 *//* 0 0.0*/28, /* 1 10.0*/23, /* 2 20.0*/17, /* 3 35.0*/10, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, }, -{/* 5 65 *//* 0 0.0*/32, /* 1 10.0*/28, /* 2 20.0*/23, /* 3 35.0*/17, /* 4 50.0*/10, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, }, -{/* 6 80 *//* 0 0.0*/35, /* 1 10.0*/32, /* 2 20.0*/28, /* 3 35.0*/23, /* 4 50.0*/17, /* 5 65.0*/10, /* 6 80.0*/0, /* 7 100.0*/0, }, -{/* 7 100 *//* 0 0.0*/37, /* 1 10.0*/35, /* 2 20.0*/32, /* 3 35.0*/28, /* 4 50.0*/23, /* 5 65.0*/17, /* 6 80.0*/10, /* 7 100.0*/0, }, + { 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 2, 0, 0, 0, 0, 0, 0 }, + { 4, 3, 2, 0, 0, 0, 0, 0 }, + { 5, 4, 3, 2, 0, 0, 0, 0 }, + { 5, 5, 4, 3, 2, 0, 0, 0 }, + { 6, 5, 5, 4, 3, 2, 0, 0 }, + { 7, 6, 5, 5, 4, 3, 2, 0 }, }; static void setMazdaMiataNbTpsTps() { diff --git a/unit_tests/tests/test_accel_enrichment.cpp b/unit_tests/tests/test_accel_enrichment.cpp index 1c75c30547..6515b0c2f0 100644 --- a/unit_tests/tests/test_accel_enrichment.cpp +++ b/unit_tests/tests/test_accel_enrichment.cpp @@ -63,7 +63,7 @@ TEST(fuel, testTpsAccelEnrichmentScheduling) { Sensor::setMockValue(SensorType::Tps1, 70); eth.fireTriggerEvents2(/* count */ 1, 25 /* ms */); - float expectedAEValue = 7; + float expectedAEValue = 1.4; // it does not matter how many times we invoke 'getTpsEnrichment' - state does not change for (int i = 0; i <20;i++) { ASSERT_NEAR(expectedAEValue, engine->tpsAccelEnrichment.getTpsEnrichment(), EPS4D);