diff --git a/firmware/config/boards/Prometheus/board_configuration.cpp b/firmware/config/boards/Prometheus/board_configuration.cpp index 37e5f77d66..e372f97e31 100644 --- a/firmware/config/boards/Prometheus/board_configuration.cpp +++ b/firmware/config/boards/Prometheus/board_configuration.cpp @@ -27,7 +27,7 @@ static void setPrometheusDefaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR/*FOUR_STROKE_CAM_SENSOR*/); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; //engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; diff --git a/firmware/config/engines/GY6_139QMB.cpp b/firmware/config/engines/GY6_139QMB.cpp index 83ce5652d7..6e47f8fc62 100644 --- a/firmware/config/engines/GY6_139QMB.cpp +++ b/firmware/config/engines/GY6_139QMB.cpp @@ -66,10 +66,10 @@ static const fuel_table_t default_139qmb_fuel_table = { static void setDefault139qmbMaps(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX); - setFuelRpmBin(1000, 11000 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingRpmBin(1000, 11000 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); + setFuelRpmBin(1000, 11000 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingRpmBin(1000, 11000 PASS_CONFIG_PARAMETER_SUFFIX); copyFuelTable(default_139qmb_fuel_table, config->fuelTable); //copyTimingTable(default_139qmb_timing_table, config->ignitionTable); diff --git a/firmware/config/engines/bmw_e34.cpp b/firmware/config/engines/bmw_e34.cpp index 0c7a6452a0..33410c1917 100644 --- a/firmware/config/engines/bmw_e34.cpp +++ b/firmware/config/engines/bmw_e34.cpp @@ -52,14 +52,14 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // Injection settings - setFlatInjectorLag(1.15 PASS_ENGINE_PARAMETER_SUFFIX); + setFlatInjectorLag(1.15 PASS_CONFIG_PARAMETER_SUFFIX); engineConfiguration->injector.flow = 750; // General settings boardConfiguration->tunerStudioSerialSpeed = 57600; engineConfiguration->rpmHardLimit = 7000; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); // for best performance at high RPM, we need to turn off 'Engine Sniffer' and 'Sensor Sniffer' boardConfiguration->sensorChartMode = SC_OFF; @@ -93,7 +93,7 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_SIGNATURE) { boardConfiguration->triggerInputPins[0] = GPIOA_5; boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED; - setWholeTimingTable(25 PASS_ENGINE_PARAMETER_SUFFIX); + setWholeTimingTable(25 PASS_CONFIG_PARAMETER_SUFFIX); boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED; diff --git a/firmware/config/engines/chevrolet_c20_1973.cpp b/firmware/config/engines/chevrolet_c20_1973.cpp index 4441d14a59..29d55e8711 100644 --- a/firmware/config/engines/chevrolet_c20_1973.cpp +++ b/firmware/config/engines/chevrolet_c20_1973.cpp @@ -38,7 +38,7 @@ void set1973c20(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->trigger.customSkippedToothCount = 0; engineConfiguration->rpmHardLimit = 5000; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); } diff --git a/firmware/config/engines/chevrolet_camaro_4.cpp b/firmware/config/engines/chevrolet_camaro_4.cpp index d6465cc849..0246dd2d9f 100644 --- a/firmware/config/engines/chevrolet_camaro_4.cpp +++ b/firmware/config/engines/chevrolet_camaro_4.cpp @@ -20,7 +20,7 @@ void setCamaro4(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); engineConfiguration->specs.displacement = 5.7; engineConfiguration->specs.cylindersCount = 8; diff --git a/firmware/config/engines/citroenBerlingoTU3JP.cpp b/firmware/config/engines/citroenBerlingoTU3JP.cpp index c8c63e2bb2..bdc2e7b4bb 100644 --- a/firmware/config/engines/citroenBerlingoTU3JP.cpp +++ b/firmware/config/engines/citroenBerlingoTU3JP.cpp @@ -98,10 +98,10 @@ void setCitroenBerlingoTU3JPConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * Algorithm Alpha-N setting */ - setAlgorithm(LM_ALPHA_N PASS_ENGINE_PARAMETER_SUFFIX); - setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER_SUFFIX); - setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_ALPHA_N PASS_CONFIG_PARAMETER_SUFFIX); + setFuelLoadBin(0, 100 PASS_CONFIG_PARAMETER_SUFFIX); + setFuelRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); /** * Outputs diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index f03da4ed19..5fee7f2508 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -144,7 +144,7 @@ void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { boardConfiguration->injectionPins[2] = GPIOB_8; // #3 boardConfiguration->injectionPins[3] = GPIOB_7; // #4 - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); #if EFI_PWM_TESTER boardConfiguration->injectionPins[4] = GPIOC_8; // #5 diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 76df4b419b..5718ce86a5 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -299,7 +299,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { */ //setWholeFuelMap(12 PASS_ENGINE_PARAMETER_SUFFIX); // copyFuelTable(alphaNfuel, config->fuelTable); - //setWholeTimingTable(12 PASS_ENGINE_PARAMETER_SUFFIX); + //setWholeTimingTable(12 PASS_CONFIG_PARAMETER_SUFFIX); copyTimingTable(fromODB, config->ignitionTable); copy2DTable(vBattTarget, config->fsioTable1); @@ -321,12 +321,12 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { //engineConfiguration->fuelAlgorithm = LM_ALPHA_N; // I want to start with a simple Alpha-N - setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelLoadBin(0, 100 PASS_CONFIG_PARAMETER_SUFFIX); setLinearCurve(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 120, 1); - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); - setFuelTablesLoadBin(20, 120 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelTablesLoadBin(20, 120 PASS_CONFIG_PARAMETER_SUFFIX); boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED; @@ -480,7 +480,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // boardConfiguration->tunerStudioSerialSpeed = 9600; boardConfiguration->tunerStudioSerialSpeed = 19200; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); //temp boardConfiguration->alternatorControlPin = GPIOD_5; engineConfiguration->targetVBatt = 14.0; diff --git a/firmware/config/engines/dodge_ram.cpp b/firmware/config/engines/dodge_ram.cpp index de2c3dac6f..236171ff42 100644 --- a/firmware/config/engines/dodge_ram.cpp +++ b/firmware/config/engines/dodge_ram.cpp @@ -23,7 +23,7 @@ void setDodgeRam1996(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->trigger.type = TT_DODGE_RAM; engineConfiguration->injector.flow = 243.6; // 23.2lb/h engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); // set cranking_charge_angle 30 engineConfiguration->crankingChargeAngle = 30; @@ -69,7 +69,7 @@ void setDodgeRam1996(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // set_global_fuel_correction 1 // set_whole_timing_map 10 - setWholeTimingTable(10 PASS_ENGINE_PARAMETER_SUFFIX); + setWholeTimingTable(10 PASS_CONFIG_PARAMETER_SUFFIX); boardConfiguration->alternatorControlPin = GPIOD_7; diff --git a/firmware/config/engines/dodge_stratus.cpp b/firmware/config/engines/dodge_stratus.cpp index ada99dd9b1..483bedd097 100644 --- a/firmware/config/engines/dodge_stratus.cpp +++ b/firmware/config/engines/dodge_stratus.cpp @@ -20,7 +20,7 @@ void setDodgeStratus(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->specs.firingOrder = FO_1_2_3_4_5_6; engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; boardConfiguration->ignitionPins[0] = GPIOC_9; diff --git a/firmware/config/engines/ford_aspire.cpp b/firmware/config/engines/ford_aspire.cpp index ae8e0434ce..e5ac191060 100644 --- a/firmware/config/engines/ford_aspire.cpp +++ b/firmware/config/engines/ford_aspire.cpp @@ -69,10 +69,10 @@ EXTERN_ENGINE; static void setDefaultAspireMaps(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX); - setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); + setFuelRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); copyFuelTable(default_aspire_fuel_table, config->fuelTable); copyTimingTable(default_aspire_timing_table, config->ignitionTable); diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index 0650881c07..aa153de160 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -79,11 +79,11 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->globalFuelCorrection = 0.75; engineConfiguration->specs.displacement = 1.839; // engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); // engineConfiguration->fuelAlgorithm = LM_REAL_MAF; - setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX); - setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); + setFuelRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); config->veRpmBins[0] = 800; config->veRpmBins[1] = 1200; diff --git a/firmware/config/engines/honda_600.cpp b/firmware/config/engines/honda_600.cpp index 17fac9852f..dfb1d53893 100644 --- a/firmware/config/engines/honda_600.cpp +++ b/firmware/config/engines/honda_600.cpp @@ -49,10 +49,10 @@ EXTERN_ENGINE; static void setDefaultCustomMaps(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - setFuelLoadBin(0,100 PASS_ENGINE_PARAMETER_SUFFIX); - setFuelRpmBin(0, 7000 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingLoadBin(0,100 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingRpmBin(0,7000 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelLoadBin(0,100 PASS_CONFIG_PARAMETER_SUFFIX); + setFuelRpmBin(0, 7000 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingLoadBin(0,100 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingRpmBin(0,7000 PASS_CONFIG_PARAMETER_SUFFIX); copyFuelTable(default_custom_fuel_table, config->fuelTable); copyFuelTable(default_custom_fuel_table, config->veTable); @@ -145,7 +145,7 @@ void setHonda600(DECLARE_ENGINE_PARAMETER_SIGNATURE) { boardConfiguration->injectionPins[3] = GPIOB_8; // #4 setDefaultCustomMaps(PASS_ENGINE_PARAMETER_SIGNATURE); - setAlgorithm(LM_ALPHA_N PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_ALPHA_N PASS_CONFIG_PARAMETER_SUFFIX); boardConfiguration->injectionPins[4] = GPIO_UNASSIGNED; boardConfiguration->injectionPins[5] = GPIO_UNASSIGNED; diff --git a/firmware/config/engines/honda_accord.cpp b/firmware/config/engines/honda_accord.cpp index 1d91eb892f..2b388b8e11 100644 --- a/firmware/config/engines/honda_accord.cpp +++ b/firmware/config/engines/honda_accord.cpp @@ -56,10 +56,10 @@ static void setHondaAccordConfigurationCommon(DECLARE_ENGINE_PARAMETER_SIGNATURE // Keihin 06164-P0A-A00 engineConfiguration->injector.flow = 248; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); - setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setFuelLoadBin(0, 100 PASS_CONFIG_PARAMETER_SUFFIX); - buildTimingMap(35 PASS_ENGINE_PARAMETER_SUFFIX); + buildTimingMap(35 PASS_CONFIG_PARAMETER_SUFFIX); /** * 18K Ohm @ -20C diff --git a/firmware/config/engines/mazda_626.cpp b/firmware/config/engines/mazda_626.cpp index d360f7afdc..336046f61f 100644 --- a/firmware/config/engines/mazda_626.cpp +++ b/firmware/config/engines/mazda_626.cpp @@ -62,8 +62,8 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->tpsMin = 80; engineConfiguration->tpsMax = 764; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); - setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setFuelLoadBin(0, 100 PASS_CONFIG_PARAMETER_SUFFIX); // set_whole_fuel_map 9 setWholeFuelMap(9 PASS_CONFIG_PARAMETER_SUFFIX); diff --git a/firmware/config/engines/mazda_miata.cpp b/firmware/config/engines/mazda_miata.cpp index 2a8e9ade36..4651b4855c 100644 --- a/firmware/config/engines/mazda_miata.cpp +++ b/firmware/config/engines/mazda_miata.cpp @@ -135,8 +135,8 @@ static void commonMiataNa(DECLARE_ENGINE_PARAMETER_SIGNATURE) { boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP engineConfiguration->ignitionMode = IM_WASTED_SPARK; - setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX); - setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); + setFuelRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); boardConfiguration->idle.solenoidFrequency = 160; diff --git a/firmware/config/engines/rover_v8.cpp b/firmware/config/engines/rover_v8.cpp index 2eecefe06a..f6637b111d 100644 --- a/firmware/config/engines/rover_v8.cpp +++ b/firmware/config/engines/rover_v8.cpp @@ -141,7 +141,7 @@ void setRoverv8(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8; - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); // todo: make this official Frankenstein joystick? boardConfiguration->joystickCenterPin = GPIOD_8; diff --git a/firmware/config/engines/sachs.cpp b/firmware/config/engines/sachs.cpp index 29c990e3b3..51845f9517 100644 --- a/firmware/config/engines/sachs.cpp +++ b/firmware/config/engines/sachs.cpp @@ -81,8 +81,8 @@ void setSachs(DECLARE_ENGINE_PARAMETER_SIGNATURE) { boardConfiguration->fuelPumpPin = GPIOE_6; // todo: extract a method? figure out something smarter - setFuelRpmBin(800, 15000 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingRpmBin(800, 15000 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelRpmBin(800, 15000 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingRpmBin(800, 15000 PASS_CONFIG_PARAMETER_SUFFIX); setLinearCurve(config->veRpmBins, FUEL_RPM_COUNT, 15000, 7000, 1); setLinearCurve(config->afrRpmBins, FUEL_RPM_COUNT, 15000, 7000, 1); diff --git a/firmware/config/engines/test_engine.cpp b/firmware/config/engines/test_engine.cpp index c4b1dbec5f..2798f88dce 100644 --- a/firmware/config/engines/test_engine.cpp +++ b/firmware/config/engines/test_engine.cpp @@ -61,7 +61,7 @@ void setTestVVTEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->trigger.customSkippedToothCount = 1; // set algorithm 3 - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED; engineConfiguration->camInput = GPIOA_5; diff --git a/firmware/config/engines/vw.cpp b/firmware/config/engines/vw.cpp index 4eee272c9f..9ace80dcf4 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_ENGINE_PARAMETER_SUFFIX); + setWholeTimingTable(20 PASS_CONFIG_PARAMETER_SUFFIX); engineConfiguration->cranking.baseFuel = 12; // set cranking_timing_angle 10 engineConfiguration->crankingTimingAngle = 10; @@ -44,7 +44,7 @@ void setVwAba(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->specs.displacement = 2.0; engineConfiguration->injector.flow = 320; // 30lb/h // set algorithm 3 - setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); engineConfiguration->map.sensor.type = MT_GM_3_BAR; engineConfiguration->ignitionMode = IM_ONE_COIL; @@ -58,8 +58,8 @@ void setVwAba(DECLARE_ENGINE_PARAMETER_SIGNATURE) { float mapRange = 110; setEgoSensor(ES_PLX PASS_ENGINE_PARAMETER_SUFFIX); - setFuelTablesLoadBin(20, mapRange PASS_ENGINE_PARAMETER_SUFFIX); - setTimingLoadBin(20, mapRange PASS_ENGINE_PARAMETER_SUFFIX); + setFuelTablesLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX); + setTimingLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX); boardConfiguration->isSdCardEnabled = false; engineConfiguration->tpsMin = 740; diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index 34f793c3d1..dd27905446 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -257,7 +257,7 @@ float getInitialAdvance(int rpm, float map, float advanceMax) { /** * this method builds a good-enough base timing advance map bases on a number of heuristics */ -void buildTimingMap(float advanceMax DECLARE_ENGINE_PARAMETER_SUFFIX) { +void buildTimingMap(float advanceMax DECLARE_CONFIG_PARAMETER_SUFFIX) { if (engineConfiguration->fuelAlgorithm != LM_SPEED_DENSITY && engineConfiguration->fuelAlgorithm != LM_MAP) { warning(CUSTOM_WRONG_ALGORITHM, "wrong algorithm for MAP-based timing"); diff --git a/firmware/controllers/algo/advance_map.h b/firmware/controllers/algo/advance_map.h index b8d2f2ca5a..18d3499332 100644 --- a/firmware/controllers/algo/advance_map.h +++ b/firmware/controllers/algo/advance_map.h @@ -15,6 +15,6 @@ void setDefaultIatTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE); void prepareTimingMap(DECLARE_ENGINE_PARAMETER_SIGNATURE); float getTopAdvanceForBore(chamber_style_e style, int octane, double compression, double bore); float getInitialAdvance(int rpm, float map, float advanceMax); -void buildTimingMap(float advanceMax DECLARE_ENGINE_PARAMETER_SUFFIX); +void buildTimingMap(float advanceMax DECLARE_CONFIG_PARAMETER_SUFFIX); #endif /* ADVANCE_H_ */ diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 9b855df66c..6799e894e6 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -240,7 +240,7 @@ void setWholeIgnitionIatCorr(float value DECLARE_ENGINE_PARAMETER_SUFFIX) { setMap(config->ignitionIatCorrTable, value); } -void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_CONFIG_PARAMETER_SUFFIX) { setLinearCurve(config->injPhaseLoadBins, FUEL_LOAD_COUNT, minValue, maxValue, 1); setLinearCurve(config->veLoadBins, FUEL_LOAD_COUNT, minValue, maxValue, 1); setLinearCurve(config->afrLoadBins, FUEL_LOAD_COUNT, minValue, maxValue, 1); @@ -261,7 +261,7 @@ void setWholeIatCorrTimingTable(float value DECLARE_ENGINE_PARAMETER_SUFFIX) { /** * See also crankingTimingAngle */ -void setWholeTimingTable(angle_t value DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setWholeTimingTable(angle_t value DECLARE_CONFIG_PARAMETER_SUFFIX) { setTimingMap(config->ignitionTable, value); } @@ -467,7 +467,7 @@ static void setBosch02880155868(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->injector.battLagCorr[7] = 0.726; } -static void setDefaultWarmupIdleCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void setDefaultWarmupIdleCorrection(DECLARE_CONFIG_PARAMETER_SIGNATURE) { initTemperatureCurve(CLT_MANUAL_IDLE_CORRECTION, PERCENT_MULT); float baseIdle = 30; @@ -684,7 +684,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setLinearCurve(engineConfiguration->fsioCurve4Bins, FSIO_CURVE_8, 0, 100, 1); - setDefaultWarmupIdleCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + setDefaultWarmupIdleCorrection(PASS_CONFIG_PARAMETER_SIGNATURE); setDefaultWarmupFuelEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE); @@ -697,10 +697,10 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->useConstantDwellDuringCranking = false; engineConfiguration->ignitionDwellForCrankingMs = 6; - setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX); - setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER_SUFFIX); - setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); + setFuelRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); setLinearCurve(engineConfiguration->map.samplingAngleBins, MAP_ANGLE_SIZE, 800, 7000, 1); setLinearCurve(engineConfiguration->map.samplingAngle, MAP_ANGLE_SIZE, 100, 130, 1); @@ -715,7 +715,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setMap(config->injectionPhase, -180); setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT); - setFuelTablesLoadBin(10, 160 PASS_ENGINE_PARAMETER_SUFFIX); + setFuelTablesLoadBin(10, 160 PASS_CONFIG_PARAMETER_SUFFIX); setDefaultIatTimingCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); setLinearCurve(engineConfiguration->mapAccelTaperBins, FSIO_TABLE_8, 0, 32, 4); diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index 2ac19dcc09..2aa1b0676a 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -57,9 +57,9 @@ void setAfrMap(afr_table_t table, float value); void setMap(fuel_table_t table, float value); void setWholeFuelMap(float value DECLARE_CONFIG_PARAMETER_SUFFIX); void setWholeIgnitionIatCorr(float value DECLARE_ENGINE_PARAMETER_SUFFIX); -void setFuelTablesLoadBin(float minValue, float maxValue 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_ENGINE_PARAMETER_SUFFIX); +void setWholeTimingTable(angle_t value DECLARE_CONFIG_PARAMETER_SUFFIX); void setConstantDwell(floatms_t dwellMs DECLARE_ENGINE_PARAMETER_SUFFIX); void printFloatArray(const char *prefix, float array[], int size); diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index 195f6f37f9..86c325dbc4 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -492,35 +492,35 @@ void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif -void setFuelRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setFuelRpmBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX) { setTableBin(config->fuelRpmBins, FUEL_RPM_COUNT, from, to); } -void setFuelLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setFuelLoadBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX) { setTableBin(config->fuelLoadBins, FUEL_LOAD_COUNT, from, to); } -void setTimingRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setTimingRpmBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX) { setRpmBin(config->ignitionRpmBins, IGN_RPM_COUNT, from, to); } -void setTimingLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setTimingLoadBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX) { setTableBin(config->ignitionLoadBins, IGN_LOAD_COUNT, from, to); } /** * this method sets algorithm and ignition table scale */ -void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setAlgorithm(engine_load_mode_e algo DECLARE_CONFIG_PARAMETER_SUFFIX) { engineConfiguration->fuelAlgorithm = algo; if (algo == LM_ALPHA_N) { - setTimingLoadBin(20, 120 PASS_ENGINE_PARAMETER_SUFFIX); + setTimingLoadBin(20, 120 PASS_CONFIG_PARAMETER_SUFFIX); } else if (algo == LM_SPEED_DENSITY) { setLinearCurve(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 120, 3); - buildTimingMap(35 PASS_ENGINE_PARAMETER_SUFFIX); + buildTimingMap(35 PASS_CONFIG_PARAMETER_SUFFIX); } } -void setFlatInjectorLag(float value DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setFlatInjectorLag(float value DECLARE_CONFIG_PARAMETER_SUFFIX) { setArrayValues(engineConfiguration->injector.battLagCorr, VBAT_INJECTOR_CURVE_SIZE, value); } diff --git a/firmware/controllers/math/engine_math.h b/firmware/controllers/math/engine_math.h index 95efeb6a9f..0ac08b7a64 100644 --- a/firmware/controllers/math/engine_math.h +++ b/firmware/controllers/math/engine_math.h @@ -14,11 +14,11 @@ #include "table_helper.h" #include "engine.h" -void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_SUFFIX); +void setAlgorithm(engine_load_mode_e algo DECLARE_CONFIG_PARAMETER_SUFFIX); #define assertEngineReference() efiAssertVoid(CUSTOM_ENGINE_REF, engine != NULL, "engine is NULL") -void setFlatInjectorLag(float value DECLARE_ENGINE_PARAMETER_SUFFIX); +void setFlatInjectorLag(float value DECLARE_CONFIG_PARAMETER_SUFFIX); #define fixAngle(angle, msg, code) fixAngle2(angle, msg, code, ENGINE(engineCycle)) @@ -57,10 +57,10 @@ void prepareIgnitionPinIndices(ignition_mode_e ignitionMode DECLARE_ENGINE_PARAM int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX); -void setFuelRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX); -void setFuelLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX); -void setTimingRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX); -void setTimingLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_SUFFIX); +void setFuelRpmBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX); +void setFuelLoadBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX); +void setTimingRpmBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX); +void setTimingLoadBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX); void setSingleCoilDwell(engine_configuration_s *engineConfiguration); diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index 286de6980f..6060ce47a4 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -52,8 +52,6 @@ EXTERN_ENGINE; #define LS_RESPONSE "ls_result" #define FILE_LIST_MAX_COUNT 20 -extern board_configuration_s *boardConfiguration; - #if HAL_USE_USB_MSD #if STM32_USB_USE_OTG2 USBDriver *usb_driver = &USBD2; diff --git a/firmware/hw_layer/neo6m.cpp b/firmware/hw_layer/neo6m.cpp index a496384341..dbe9f7642b 100644 --- a/firmware/hw_layer/neo6m.cpp +++ b/firmware/hw_layer/neo6m.cpp @@ -26,9 +26,6 @@ #include "rtc_helper.h" #include "engine.h" -extern board_configuration_s *boardConfiguration; -extern engine_configuration_s *engineConfiguration; - static LoggingWithStorage logging("uart gps"); static SerialConfig GPSserialConfig = { GPS_SERIAL_SPEED, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 }; diff --git a/unit_tests/global.h b/unit_tests/global.h index 3066e13b0d..f7fc54867f 100644 --- a/unit_tests/global.h +++ b/unit_tests/global.h @@ -56,6 +56,7 @@ void print(const char *fmt, ...); #define CCM_OPTIONAL #define EXTERN_ENGINE extern EnginePins enginePins +#define EXTERN_CONFIG #ifdef __cplusplus class Engine; diff --git a/unit_tests/tests/test_fuel_map.cpp b/unit_tests/tests/test_fuel_map.cpp index a07f1bd39c..9a7d73fd9c 100644 --- a/unit_tests/tests/test_fuel_map.cpp +++ b/unit_tests/tests/test_fuel_map.cpp @@ -86,7 +86,7 @@ void testFuelMap(void) { eth.engine.config->cltFuelCorr[i] = 100; } - setFlatInjectorLag(0 PASS_ENGINE_PARAMETER_SUFFIX); + setFlatInjectorLag(0 PASS_CONFIG_PARAMETER_SUFFIX); assertEquals(NAN, getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE)); float iatCorrection = getIatFuelCorrection(-KELV PASS_ENGINE_PARAMETER_SUFFIX); diff --git a/unit_tests/tests/test_trigger_decoder.cpp b/unit_tests/tests/test_trigger_decoder.cpp index bbe030a67c..713ff8a468 100644 --- a/unit_tests/tests/test_trigger_decoder.cpp +++ b/unit_tests/tests/test_trigger_decoder.cpp @@ -317,7 +317,7 @@ void testRpmCalculator(void) { engineConfiguration->globalFuelCorrection = 3; eth.applyTriggerShape(); - setFlatInjectorLag(0 PASS_ENGINE_PARAMETER_SUFFIX); + setFlatInjectorLag(0 PASS_CONFIG_PARAMETER_SUFFIX); engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); timeNowUs = 0; @@ -1201,7 +1201,7 @@ void testSparkReverseOrderBug319(void) { timeNowUs = 0; - setWholeTimingTable(0 PASS_ENGINE_PARAMETER_SUFFIX); + setWholeTimingTable(0 PASS_CONFIG_PARAMETER_SUFFIX); eth.fireRise(20); @@ -1327,7 +1327,7 @@ void testMissedSpark299(void) { assertEquals(3000, eth.engine.rpmCalculator.rpmValue); - setWholeTimingTable(3 PASS_ENGINE_PARAMETER_SUFFIX); + setWholeTimingTable(3 PASS_CONFIG_PARAMETER_SUFFIX); eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); @@ -1344,7 +1344,7 @@ void testMissedSpark299(void) { eth.fireFall(20); engine->executor.executeAll(timeNowUs); - setWholeTimingTable(-5 PASS_ENGINE_PARAMETER_SUFFIX); + setWholeTimingTable(-5 PASS_CONFIG_PARAMETER_SUFFIX); eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);