diff --git a/firmware/config/engines/bmw_e34.cpp b/firmware/config/engines/bmw_e34.cpp index 33410c1917..a4eee41ee0 100644 --- a/firmware/config/engines/bmw_e34.cpp +++ b/firmware/config/engines/bmw_e34.cpp @@ -93,7 +93,7 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_SIGNATURE) { boardConfiguration->triggerInputPins[0] = GPIOA_5; boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED; - setWholeTimingTable(25 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable(25); boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED; diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 5718ce86a5..2036503b45 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -178,7 +178,7 @@ void setDodgeNeon1995EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // set_whole_fuel_map 9 setWholeFuelMap(9 PASS_CONFIG_PARAMETER_SUFFIX); - setWholeTimingTable(12 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable_d(12 PASS_CONFIG_PARAMETER_SUFFIX); // set cranking_injection_mode 0 engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; @@ -299,7 +299,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { */ //setWholeFuelMap(12 PASS_ENGINE_PARAMETER_SUFFIX); // copyFuelTable(alphaNfuel, config->fuelTable); - //setWholeTimingTable(12 PASS_CONFIG_PARAMETER_SUFFIX); + //setWholeTimingTable_d(12 PASS_CONFIG_PARAMETER_SUFFIX); copyTimingTable(fromODB, config->ignitionTable); copy2DTable(vBattTarget, config->fsioTable1); diff --git a/firmware/config/engines/dodge_ram.cpp b/firmware/config/engines/dodge_ram.cpp index 236171ff42..32236c32ba 100644 --- a/firmware/config/engines/dodge_ram.cpp +++ b/firmware/config/engines/dodge_ram.cpp @@ -69,7 +69,7 @@ void setDodgeRam1996(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // set_global_fuel_correction 1 // set_whole_timing_map 10 - setWholeTimingTable(10 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable_d(10 PASS_CONFIG_PARAMETER_SUFFIX); boardConfiguration->alternatorControlPin = GPIOD_7; diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index aa153de160..19b8283f3b 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -147,7 +147,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->cranking.baseFuel = 9; setLinearCurve(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 105, 5); - setWholeTimingTable(10 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable_d(10 PASS_CONFIG_PARAMETER_SUFFIX); // set_whole_fuel_map 5 setWholeFuelMap(5 PASS_CONFIG_PARAMETER_SUFFIX); setAfrMap(config->afrTable, 13.5); diff --git a/firmware/config/engines/mazda_626.cpp b/firmware/config/engines/mazda_626.cpp index 336046f61f..20ecb7a557 100644 --- a/firmware/config/engines/mazda_626.cpp +++ b/firmware/config/engines/mazda_626.cpp @@ -69,7 +69,7 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setWholeFuelMap(9 PASS_CONFIG_PARAMETER_SUFFIX); // set_whole_timing_map 10 - setWholeTimingTable(10 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable_d(10 PASS_CONFIG_PARAMETER_SUFFIX); // http://s1.micp.ru/tOb0U.png setThermistorConfiguration(&engineConfiguration->clt, -15, 5900, 23, 1750, 97, 165); diff --git a/firmware/config/engines/vw.cpp b/firmware/config/engines/vw.cpp index 9ace80dcf4..338cfb7f8d 100644 --- a/firmware/config/engines/vw.cpp +++ b/firmware/config/engines/vw.cpp @@ -18,7 +18,7 @@ EXTERN_ENGINE; void setVwAba(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); - setWholeTimingTable(20 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable_d(20 PASS_CONFIG_PARAMETER_SUFFIX); engineConfiguration->cranking.baseFuel = 12; // set cranking_timing_angle 10 engineConfiguration->crankingTimingAngle = 10; diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 6799e894e6..c0e7f07e39 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -261,7 +261,7 @@ void setWholeIatCorrTimingTable(float value DECLARE_ENGINE_PARAMETER_SUFFIX) { /** * See also crankingTimingAngle */ -void setWholeTimingTable(angle_t value DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setWholeTimingTable_d(angle_t value DECLARE_CONFIG_PARAMETER_SUFFIX) { setTimingMap(config->ignitionTable, value); } diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index 2aa1b0676a..3c5ecb3c62 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -59,7 +59,8 @@ void setWholeFuelMap(float value DECLARE_CONFIG_PARAMETER_SUFFIX); void setWholeIgnitionIatCorr(float value DECLARE_ENGINE_PARAMETER_SUFFIX); void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_CONFIG_PARAMETER_SUFFIX); void setWholeIatCorrTimingTable(float value DECLARE_ENGINE_PARAMETER_SUFFIX); -void setWholeTimingTable(angle_t value DECLARE_CONFIG_PARAMETER_SUFFIX); +void setWholeTimingTable_d(angle_t value DECLARE_CONFIG_PARAMETER_SUFFIX); +#define setWholeTimingTable(x) setWholeTimingTable_d(x PASS_CONFIG_PARAMETER_SUFFIX); void setConstantDwell(floatms_t dwellMs DECLARE_ENGINE_PARAMETER_SUFFIX); void printFloatArray(const char *prefix, float array[], int size); diff --git a/unit_tests/tests/test_trigger_decoder.cpp b/unit_tests/tests/test_trigger_decoder.cpp index 713ff8a468..8b6847be16 100644 --- a/unit_tests/tests/test_trigger_decoder.cpp +++ b/unit_tests/tests/test_trigger_decoder.cpp @@ -1201,7 +1201,7 @@ void testSparkReverseOrderBug319(void) { timeNowUs = 0; - setWholeTimingTable(0 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable(0); eth.fireRise(20); @@ -1327,7 +1327,7 @@ void testMissedSpark299(void) { assertEquals(3000, eth.engine.rpmCalculator.rpmValue); - setWholeTimingTable(3 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable(3); eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); @@ -1344,7 +1344,7 @@ void testMissedSpark299(void) { eth.fireFall(20); engine->executor.executeAll(timeNowUs); - setWholeTimingTable(-5 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable(-5); eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);