From 9f7028aa5d1d4fee5d545e6198dc8bf26346c237 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 6 Mar 2024 11:59:07 -0500 Subject: [PATCH] only: coupe --- firmware/config/engines/hyundai.cpp | 3 +- .../config/engines/hyundai_coupe_canned.cpp | 21 --------- .../engines/hyundai_coupe_canned_tables.cpp | 45 +++++++++++++++++++ firmware/config/engines/hyundai_pb_canned.cpp | 6 +-- .../engines/hyundai_pb_canned_tables.cpp | 6 +-- 5 files changed, 53 insertions(+), 28 deletions(-) delete mode 100644 firmware/config/engines/hyundai_coupe_canned.cpp create mode 100644 firmware/config/engines/hyundai_coupe_canned_tables.cpp diff --git a/firmware/config/engines/hyundai.cpp b/firmware/config/engines/hyundai.cpp index 9bec92f6bb..0e262da3ef 100644 --- a/firmware/config/engines/hyundai.cpp +++ b/firmware/config/engines/hyundai.cpp @@ -15,7 +15,7 @@ https://rusefi.com/docs/pinouts/hellen/hellen154hyundai/ #include "hellen_meta.h" #include "defaults.h" #include "lua_lib.h" -#include "hyundai_coupe_canned.cpp" +#include "hyundai_coupe_canned_tables.cpp" #include "hyundai_pb_canned.cpp" static void set201xHyundai() { @@ -249,6 +249,7 @@ static void commonGenesisCoupe() { cannedprimeValues(); cannedcltIdleCorrBins(); cannedcltIdleCorr(); + cannedignitionTable(); #endif // HW_HELLEN_HYUNDAI engineConfiguration->displayLogicLevelsInEngineSniffer = true; diff --git a/firmware/config/engines/hyundai_coupe_canned.cpp b/firmware/config/engines/hyundai_coupe_canned.cpp deleted file mode 100644 index ebfb07da0f..0000000000 --- a/firmware/config/engines/hyundai_coupe_canned.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#if HW_HELLEN_HYUNDAI -static void cannedprimeBins() { - static const float hardCodedprimeBins[8] = {-40.0, -20.0, 0.0, 20.0, 40.0, 60.0, 80.0, 100.0}; - copyArray(engineConfiguration->primeBins, hardCodedprimeBins); -} - -static void cannedprimeValues() { - static const float hardCodedprimeValues[8] = {755.0, 605.0, 265.0, 140.0, 75.0, 50.0, 45.0, 40.0}; - copyArray(engineConfiguration->primeValues, hardCodedprimeValues); -} - -static void cannedcltIdleCorrBins() { - static const float hardCodedcltIdleCorrBins[16] = {-40.0, -30.0, -20.0, -10.0, 0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}; - copyArray(config->cltIdleCorrBins, hardCodedcltIdleCorrBins); -} - -static void cannedcltIdleCorr() { - static const float hardCodedcltIdleCorr[16] = {1.5, 1.5, 1.333333, 1.333333, 1.333333, 1.333333, 1.333333, 1.333333, 1.333333, 1.233333, 1.166667, 1.1, 1.0, 1.0, 1.0, 1.0}; - copyArray(config->cltIdleCorr, hardCodedcltIdleCorr); -} -#endif // HW_HELLEN_HYUNDAI diff --git a/firmware/config/engines/hyundai_coupe_canned_tables.cpp b/firmware/config/engines/hyundai_coupe_canned_tables.cpp new file mode 100644 index 0000000000..46e551c274 --- /dev/null +++ b/firmware/config/engines/hyundai_coupe_canned_tables.cpp @@ -0,0 +1,45 @@ +#if HW_HELLEN_HYUNDAI +static void cannedprimeBins() { + static const float hardCodedprimeBins[8] = {-40.0, -20.0, 0.0, 20.0, 40.0, 60.0, 80.0, 100.0}; + copyArray(engineConfiguration->primeBins, hardCodedprimeBins); +} + +static void cannedprimeValues() { + static const float hardCodedprimeValues[8] = {755.0, 605.0, 265.0, 140.0, 75.0, 50.0, 45.0, 40.0}; + copyArray(engineConfiguration->primeValues, hardCodedprimeValues); +} + +static void cannedcltIdleCorrBins() { + static const float hardCodedcltIdleCorrBins[16] = {-40.0, -30.0, -20.0, -10.0, 0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}; + copyArray(config->cltIdleCorrBins, hardCodedcltIdleCorrBins); +} + +static void cannedcltIdleCorr() { + static const float hardCodedcltIdleCorr[16] = {1.5, 1.5, 1.333333, 1.333333, 1.333333, 1.333333, 1.333333, 1.333333, 1.333333, 1.233333, 1.166667, 1.1, 1.0, 1.0, 1.0, 1.0}; + copyArray(config->cltIdleCorr, hardCodedcltIdleCorr); +} + +static void cannedignitionTable() { + static const float hardCodedignitionTable[16][16] = { +{12.100, 14.000, 17.800, 22.900, 29.300, 35.600, -20.000, -20.000, -20.000, -20.000, -20.000, -20.000, 42.000, 42.000, 42.000, 42.000, }, +{11.800, 13.700, 10.000, 14.900, 28.600, 34.800, -20.000, -20.000, -20.000, -20.000, -20.000, -20.000, 41.000, 41.000, 41.000, 41.000, }, +{11.600, 13.400, 12.300, 17.100, 28.000, 33.900, 39.200, 40.000, 40.000, 40.000, 40.000, 40.000, 40.000, 40.000, 40.000, 40.000, }, +{11.400, 13.200, 16.700, 21.400, 27.300, 33.100, 38.200, 39.000, 39.000, 39.000, 39.000, 39.000, 39.000, 39.000, 39.000, 39.000, }, +{11.200, 12.900, 16.300, 20.800, 26.600, 32.300, 37.200, 38.000, 38.000, 38.000, 38.000, 38.000, 38.000, 38.000, 38.000, 38.000, }, +{10.900, 12.600, 16.600, 20.200, 26.400, 26.700, 27.000, 28.500, 30.000, 30.400, 30.800, 31.100, 31.500, 31.900, 32.300, 33.000, }, +{10.800, 12.400, 16.800, 19.600, 23.900, 24.200, 24.500, 26.000, 27.500, 27.900, 28.300, 28.600, 29.000, 29.400, 29.800, 30.500, }, +{14.300, 14.900, 16.500, 18.800, 20.700, 21.700, 22.000, 23.500, 25.000, 25.400, 25.800, 26.100, 26.500, 26.900, 27.300, 28.000, }, +{14.000, 14.600, 15.600, 17.100, 18.500, 19.200, 19.500, 21.000, 22.500, 22.900, 23.300, 23.600, 24.000, 24.400, 24.800, 25.500, }, +{12.900, 13.300, 14.000, 15.100, 16.100, 16.700, 17.000, 18.500, 20.000, 20.400, 20.800, 21.100, 21.500, 21.900, 22.300, 23.000, }, +{11.700, 12.000, 12.400, 13.100, 13.700, 14.200, 14.500, 16.000, 17.500, 17.900, 18.300, 18.600, 19.000, 19.400, 19.800, 20.500, }, +{10.400, 10.500, 10.800, 11.100, 11.500, 11.900, 12.000, 13.500, 15.000, 15.400, 15.800, 16.100, 16.500, 16.900, 17.300, 18.000, }, +{8.800, 9.000, 9.100, 9.400, 9.700, 10.000, 10.300, 11.800, 13.300, 13.700, 14.100, 14.400, 14.800, 15.200, 15.600, 16.300, }, +{6.700, 6.800, 7.500, 7.700, 8.000, 8.400, 8.700, 10.200, 11.700, 12.100, 12.500, 12.800, 13.200, 13.600, 14.000, 14.700, }, +{1.800, 5.600, 6.200, 6.500, 6.800, 7.100, 7.000, 8.500, 10.000, 10.400, 10.800, 11.100, 11.500, 11.900, 12.300, 13.000, }, +{-1.200, 2.600, 3.200, 3.600, 4.100, 5.000, 7.100, 7.800, 8.400, 9.000, 9.400, 9.500, 9.700, 9.800, 10.000, 10.000, }, +}; + copyTable(config->ignitionTable, hardCodedignitionTable); +} + + +#endif // HW_HELLEN_HYUNDAI diff --git a/firmware/config/engines/hyundai_pb_canned.cpp b/firmware/config/engines/hyundai_pb_canned.cpp index 794ede5c2a..7d1a8c6732 100644 --- a/firmware/config/engines/hyundai_pb_canned.cpp +++ b/firmware/config/engines/hyundai_pb_canned.cpp @@ -4,9 +4,9 @@ void cannedPbTables() { #if (IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT) && (IGN_RPM_COUNT == DEFAULT_IGN_RPM_COUNT) && (FUEL_LOAD_COUNT == DEFAULT_FUEL_LOAD_COUNT) && (FUEL_RPM_COUNT == DEFAULT_FUEL_LOAD_COUNT) cannedvvtTable1(); cannedvvtTable2(); - cannedignitionTable(); - cannedveTable(); + pbcannedignitionTable(); + pbcannedveTable(); cannedinjectionPhase(); - cannedlambdaTable(); + pbcannedlambdaTable(); #endif } diff --git a/firmware/config/engines/hyundai_pb_canned_tables.cpp b/firmware/config/engines/hyundai_pb_canned_tables.cpp index 54aac28bd4..114d61cfc6 100644 --- a/firmware/config/engines/hyundai_pb_canned_tables.cpp +++ b/firmware/config/engines/hyundai_pb_canned_tables.cpp @@ -28,7 +28,7 @@ static void cannedvvtTable2() { copyTable(config->vvtTable2, hardCodedvvtTable2); } -static void cannedignitionTable() { +static void pbcannedignitionTable() { static const float hardCodedignitionTable[16][16] = { {12.200, 14.200, 18.100, 23.300, 29.900, 36.400, 39.200, 40.000, -10.000, -10.000, -10.000, -10.000, -10.000, -10.000, -10.000, -10.000, }, {12.100, 14.000, 17.800, 22.900, 29.300, 35.600, 39.000, 39.800, -10.000, -10.000, -10.000, -10.000, -10.000, -10.000, -10.000, -10.000, }, @@ -50,7 +50,7 @@ static void cannedignitionTable() { copyTable(config->ignitionTable, hardCodedignitionTable); } -static void cannedveTable() { +static void pbcannedveTable() { static const float hardCodedveTable[16][16] = { {70.300, 70.300, 70.400, 70.500, 70.600, 70.600, 70.300, 29.900, 29.800, 29.900, 30.400, 31.400, 33.000, 35.100, 37.700, 40.900, }, {70.800, 71.500, 72.100, 72.900, 73.300, 72.800, 72.000, 31.300, 31.200, 31.500, 32.200, 33.500, 35.300, 37.700, 40.500, 43.900, }, @@ -94,7 +94,7 @@ static void cannedinjectionPhase() { copyTable(config->injectionPhase, hardCodedinjectionPhase); } -static void cannedlambdaTable() { +static void pbcannedlambdaTable() { static const float hardCodedlambdaTable[16][16] = { {14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, }, {14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, 14.700, },