diff --git a/firmware/config/engines/bmw_e34.cpp b/firmware/config/engines/bmw_e34.cpp index 2878dd1454..dbd85a6cc9 100644 --- a/firmware/config/engines/bmw_e34.cpp +++ b/firmware/config/engines/bmw_e34.cpp @@ -41,7 +41,7 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->ignMathCalculateAtIndex = 15; - setConstantDwell(engineConfiguration, 3); // a bit shorter dwell + setConstantDwell(3 PASS_ENGINE_PARAMETER); // a bit shorter dwell engineConfiguration->useConstantDwellDuringCranking = true; engineConfiguration->ignitionDwellForCrankingMs = 5; diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index e33386af65..224f3dbf2a 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -376,7 +376,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->bc.fsio_setting[0] = 0.2; #if EFI_FSIO || defined(__DOXYGEN__) boardConfiguration->fsio_setting[0] = 0.55; - setFsioExt(engineConfiguration, 0, GPIOE_5, "0 fsio_setting", 400); + setFsioExt(0, GPIOE_5, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER); #endif boardConfiguration->vehicleSpeedSensorInputPin = GPIOA_8; diff --git a/firmware/config/engines/ford_1995_inline_6.cpp b/firmware/config/engines/ford_1995_inline_6.cpp index a5140f75c3..e6f506418c 100644 --- a/firmware/config/engines/ford_1995_inline_6.cpp +++ b/firmware/config/engines/ford_1995_inline_6.cpp @@ -19,10 +19,13 @@ #if EFI_SUPPORT_1995_FORD_INLINE_6 || defined(__DOXYGEN__) +EXTERN_ENGINE; + /** * @brief Default values for persistent properties */ -void setFordInline6(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) { +void setFordInline6(DECLARE_ENGINE_PARAMETER_F) { + board_configuration_s *boardConfiguration = &engineConfiguration->bc; engineConfiguration->specs.cylindersCount = 6; setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR); @@ -36,7 +39,7 @@ void setFordInline6(engine_configuration_s *engineConfiguration, board_configura /** * 0.5ms dweel time just to be sure it would fit within camshaft revolution, dwell is not controlled by us anyway */ - setConstantDwell(engineConfiguration, 0.5); + setConstantDwell(0.5 PASS_ENGINE_PARAMETER); /** * We treat the trigger as 6/0 toothed wheel diff --git a/firmware/config/engines/ford_1995_inline_6.h b/firmware/config/engines/ford_1995_inline_6.h index e1bfbd1ada..2150456019 100644 --- a/firmware/config/engines/ford_1995_inline_6.h +++ b/firmware/config/engines/ford_1995_inline_6.h @@ -10,6 +10,6 @@ #include "engine_configuration.h" -void setFordInline6(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration); +void setFordInline6(DECLARE_ENGINE_PARAMETER_F); #endif /* FORD_1995_INLINE_6_H_ */ diff --git a/firmware/config/engines/mazda_626.cpp b/firmware/config/engines/mazda_626.cpp index 9778ff764c..b8140de500 100644 --- a/firmware/config/engines/mazda_626.cpp +++ b/firmware/config/engines/mazda_626.cpp @@ -77,7 +77,7 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { #if EFI_FSIO || defined(__DOXYGEN__) // backup main relay pin - setFsio(engineConfiguration, 0, GPIOE_6, "1"); + setFsio(0, GPIOE_6, "1" PASS_ENGINE_PARAMETER); #endif engineConfiguration->externalKnockSenseAdc = EFI_ADC_4; diff --git a/firmware/config/engines/mitsubishi.cpp b/firmware/config/engines/mitsubishi.cpp index 1345928ac7..c174d7978b 100644 --- a/firmware/config/engines/mitsubishi.cpp +++ b/firmware/config/engines/mitsubishi.cpp @@ -88,7 +88,7 @@ void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_F) { initEgoSensor(&engineConfiguration->afr, ES_Innovate_MTX_L); #if EFI_FSIO || defined(__DOXYGEN__) - setFsio(engineConfiguration, 0, GPIOD_11, "rpm 5500 >"); + setFsio(0, GPIOD_11, "rpm 5500 >" PASS_ENGINE_PARAMETER); #endif } diff --git a/firmware/config/engines/test_engine.cpp b/firmware/config/engines/test_engine.cpp index d0d9ae97e9..db8cfd425a 100644 --- a/firmware/config/engines/test_engine.cpp +++ b/firmware/config/engines/test_engine.cpp @@ -7,10 +7,12 @@ * @author Andrey Belomutskiy, (c) 2012-2015 */ -#include "main.h" +#include "engine.h" #include "test_engine.h" -void setTestEngineConfiguration(engine_configuration_s *engineConfiguration) { +EXTERN_ENGINE; + +void setTestEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->trigger.type = TT_TOOTHED_WHEEL; trigger_config_s *triggerConfig = &engineConfiguration->trigger; @@ -20,7 +22,7 @@ void setTestEngineConfiguration(engine_configuration_s *engineConfiguration) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->ignitionMode = IM_ONE_COIL; - setConstantDwell(engineConfiguration, 3); // 50% duty cycle @ 5000 rpm + setConstantDwell(3 PASS_ENGINE_PARAMETER); // 50% duty cycle @ 5000 rpm board_configuration_s *bc = &engineConfiguration->bc; bc->malfunctionIndicatorPin = GPIO_UNASSIGNED; diff --git a/firmware/config/engines/test_engine.h b/firmware/config/engines/test_engine.h index 3aa1f29275..07622a6352 100644 --- a/firmware/config/engines/test_engine.h +++ b/firmware/config/engines/test_engine.h @@ -9,6 +9,6 @@ #include "engine_configuration.h" -void setTestEngineConfiguration(engine_configuration_s *engineConfiguration); +void setTestEngineConfiguration(DECLARE_ENGINE_PARAMETER_F); #endif /* TEST_ENGINE_H_ */ diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index efa44cee2b..0ceedb7c04 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -97,7 +97,7 @@ void incrementGlobalConfigurationVersion(void) { /** * @brief Sets the same dwell time across the whole getRpm() range */ -void setConstantDwell(engine_configuration_s *engineConfiguration, float dwellMs) { +void setConstantDwell(float dwellMs DECLARE_ENGINE_PARAMETER_S) { for (int i = 0; i < DWELL_CURVE_SIZE; i++) { engineConfiguration->sparkDwellBins[i] = 1000 * i; engineConfiguration->sparkDwell[i] = dwellMs; @@ -199,7 +199,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->injector.battLagCorr[i] = 0; // zero extra time by default } - setConstantDwell(engineConfiguration, 4); // 4ms is global default dwell + setConstantDwell(4 PASS_ENGINE_PARAMETER); // 4ms is global default dwell engineConfiguration->useConstantDwellDuringCranking = false; setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER); @@ -637,7 +637,7 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN break; #if EFI_SUPPORT_1995_FORD_INLINE_6 || defined(__DOXYGEN__) case FORD_INLINE_6_1995: - setFordInline6(engineConfiguration, boardConfiguration); + setFordInline6(PASS_ENGINE_PARAMETER_F); break; #endif /* EFI_SUPPORT_1995_FORD_INLINE_6 */ case GY6_139QMB: @@ -686,7 +686,7 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN setBmwE34(PASS_ENGINE_PARAMETER_F); break; case TEST_ENGINE: - setTestEngineConfiguration(engineConfiguration); + setTestEngineConfiguration(PASS_ENGINE_PARAMETER_F); break; case SACHS: setSachs(engineConfiguration); diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index 3279358cb3..11cbd197a6 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -50,7 +50,7 @@ void setMap(fuel_table_t table, float value); void setWholeFuelMap(float value DECLARE_ENGINE_PARAMETER_S); void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_ENGINE_PARAMETER_S); void setWholeTimingTable(float value DECLARE_ENGINE_PARAMETER_S); -void setConstantDwell(engine_configuration_s *engineConfiguration, float dwellMs); +void setConstantDwell(float dwellMs DECLARE_ENGINE_PARAMETER_S); void printFloatArray(const char *prefix, float array[], int size); void incrementGlobalConfigurationVersion(void); diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 9a0b3f45b4..edbb8cbcda 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -115,7 +115,7 @@ static void setFsioPin(const char *indexStr, const char *pinName) { } #endif -void setFsioExt(engine_configuration_s *engineConfiguration, int index, brain_pin_e pin, const char * exp, int freq) { +void setFsioExt(int index, brain_pin_e pin, const char * exp, int freq DECLARE_ENGINE_PARAMETER_S) { board_configuration_s *boardConfiguration = &engineConfiguration->bc; boardConfiguration->fsioPins[index] = pin; @@ -127,8 +127,8 @@ void setFsioExt(engine_configuration_s *engineConfiguration, int index, brain_pi boardConfiguration->fsioFrequency[index] = freq; } -void setFsio(engine_configuration_s *engineConfiguration, int index, brain_pin_e pin, const char * exp) { - setFsioExt(engineConfiguration, index, pin, exp, NO_PWM); +void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_ENGINE_PARAMETER_S) { + setFsioExt(index, pin, exp, NO_PWM PASS_ENGINE_PARAMETER); } void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_F) { diff --git a/firmware/controllers/core/fsio_impl.h b/firmware/controllers/core/fsio_impl.h index 705de0651c..65cfcd97bc 100644 --- a/firmware/controllers/core/fsio_impl.h +++ b/firmware/controllers/core/fsio_impl.h @@ -30,8 +30,8 @@ #define FAN_CONTROL_LOGIC "fan coolant fan_off_setting > & coolant fan_on_setting > OR" float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action); -void setFsio(engine_configuration_s *engineConfiguration, int index, brain_pin_e pin, const char * exp); -void setFsioExt(engine_configuration_s *engineConfiguration, int index, brain_pin_e pin, const char * exp, int freq); +void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_ENGINE_PARAMETER_S); +void setFsioExt(int index, brain_pin_e pin, const char * exp, int freq DECLARE_ENGINE_PARAMETER_S); void initFsioImpl(Logging *sharedLogger, Engine *engine); void runFsio(void); diff --git a/unit_tests/engine_test_helper.cpp b/unit_tests/engine_test_helper.cpp index 78117f631d..3236548de9 100644 --- a/unit_tests/engine_test_helper.cpp +++ b/unit_tests/engine_test_helper.cpp @@ -17,6 +17,7 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persiste ec = &persistentConfig.engineConfiguration; engineConfiguration = ec; + persistent_config_s *config = &persistentConfig; setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5); setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, -30, 1.5); @@ -48,9 +49,9 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persiste void EngineTestHelper::fireTriggerEvents() { for (int i = 0; i < 24; i++) { timeNow += 5000; // 5ms - triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP, &engine, engine.engineConfiguration); + triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP, &engine, engine.engineConfiguration, &persistentConfig); timeNow += 5000; - triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN, &engine, engine.engineConfiguration); + triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN, &engine, engine.engineConfiguration, &persistentConfig); } } diff --git a/unit_tests/global.h b/unit_tests/global.h index 2d05846d53..7fc597c3d2 100644 --- a/unit_tests/global.h +++ b/unit_tests/global.h @@ -38,10 +38,14 @@ typedef int bool_t; class Engine; #endif -#define DECLARE_ENGINE_PARAMETER_F Engine *engine, engine_configuration_s *engineConfiguration -#define DECLARE_ENGINE_PARAMETER_S , Engine *engine, engine_configuration_s *engineConfiguration -#define PASS_ENGINE_PARAMETER_F engine, engineConfiguration -#define PASS_ENGINE_PARAMETER , engine, engineConfiguration +#define DECLARE_ENGINE_PARAMETER_F Engine *engine, engine_configuration_s *engineConfiguration, persistent_config_s *config +#define DECLARE_ENGINE_PARAMETER_S , Engine *engine, engine_configuration_s *engineConfiguration, persistent_config_s *config +#define PASS_ENGINE_PARAMETER_F engine, engineConfiguration, config +#define PASS_ENGINE_PARAMETER , engine, engineConfiguration, config + +#define EXPAND_EngineTestHelper Engine *engine = ð.engine; \ + engine_configuration_s *engineConfiguration = engine->engineConfiguration; \ + persistent_config_s *config = engine->config; #define CONFIG(x) engineConfiguration->x #define ENGINE(x) engine->x diff --git a/unit_tests/test_engine_math.cpp b/unit_tests/test_engine_math.cpp index b3be520076..0a97d52ee3 100644 --- a/unit_tests/test_engine_math.cpp +++ b/unit_tests/test_engine_math.cpp @@ -17,8 +17,7 @@ void testIgnitionPlanning(void) { printf("*************************************************** testIgnitionPlanning\r\n"); EngineTestHelper eth(FORD_ESCORT_GT); - Engine * engine = ð.engine; - engine_configuration_s *engineConfiguration = engine->engineConfiguration; + EXPAND_EngineTestHelper; assertEquals(IM_BATCH, engineConfiguration->injectionMode); } diff --git a/unit_tests/test_fuel_map.cpp b/unit_tests/test_fuel_map.cpp index c9296b7511..7d4e0414d8 100644 --- a/unit_tests/test_fuel_map.cpp +++ b/unit_tests/test_fuel_map.cpp @@ -21,12 +21,9 @@ extern float testMafValue; void testMafFuelMath(void) { printf("*************************************************** testMafFuelMath\r\n"); EngineTestHelper eth(FORD_ASPIRE_1996); - - Engine *engine = ð.engine; - engine_configuration_s *engineConfiguration = engine->engineConfiguration; + EXPAND_EngineTestHelper; engineConfiguration->algorithm = LM_REAL_MAF; - engineConfiguration->injector.flow = 200; setMap(engineConfiguration->afrTable, 13); @@ -40,6 +37,7 @@ void testFuelMap(void) { printf("Setting up FORD_ASPIRE_1996\r\n"); EngineTestHelper eth(FORD_ASPIRE_1996); + EXPAND_EngineTestHelper; printf("Filling fuel map\r\n"); for (int k = 0; k < FUEL_LOAD_COUNT; k++) { @@ -56,12 +54,8 @@ void testFuelMap(void) { printf("*************************************************** initThermistors\r\n"); - Engine *engine = ð.engine; - engine_configuration_s *engineConfiguration = engine->engineConfiguration; - initThermistors(NULL PASS_ENGINE_PARAMETER); - printf("*** getInjectorLag\r\n"); assertEquals(1.0, getInjectorLag(12 PASS_ENGINE_PARAMETER)); @@ -171,9 +165,7 @@ void testAngleResolver(void) { printf("*************************************************** testAngleResolver\r\n"); EngineTestHelper eth(FORD_ASPIRE_1996); - Engine *engine = ð.engine; - - engine_configuration_s *engineConfiguration = eth.engine.engineConfiguration; + EXPAND_EngineTestHelper; engineConfiguration->globalTriggerAngleOffset = 175; assertTrue(engine->engineConfiguration2!=NULL); diff --git a/unit_tests/test_idle_controller.cpp b/unit_tests/test_idle_controller.cpp index cd2b933cde..5ad8663933 100644 --- a/unit_tests/test_idle_controller.cpp +++ b/unit_tests/test_idle_controller.cpp @@ -20,8 +20,7 @@ static IdleValveState is; void testIdleController(void) { print("******************************************* testIdleController\r\n"); EngineTestHelper eth(FORD_INLINE_6_1995); - Engine *engine = ð.engine; - engine_configuration_s *engineConfiguration = engine->engineConfiguration; + EXPAND_EngineTestHelper; engineConfiguration->targetIdleRpm = 1200; diff --git a/unit_tests/test_speed_density.cpp b/unit_tests/test_speed_density.cpp index 86695c0eaf..065806f6f2 100644 --- a/unit_tests/test_speed_density.cpp +++ b/unit_tests/test_speed_density.cpp @@ -13,8 +13,7 @@ void testSpeedDensity(void) { printf("*************************************************** testSpeedDensity\r\n"); EngineTestHelper eth(FORD_INLINE_6_1995); - Engine *engine = ð.engine; - engine_configuration_s *engineConfiguration = engine->engineConfiguration; + EXPAND_EngineTestHelper; eth.ec->trigger.customTotalToothCount = 8; eth.initTriggerShapeAndRpmCalculator(); diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index c9734b4962..8b6e8feb11 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -43,9 +43,8 @@ void sendOutConfirmation(char *value, int i) { int getTheAngle(engine_type_e engineType) { EngineTestHelper eth(engineType); + EXPAND_EngineTestHelper; - Engine *engine = ð.engine; - engine_configuration_s *engineConfiguration = eth.ec; initDataStructures(PASS_ENGINE_PARAMETER_F); TriggerShape * shape = ð.engine.triggerShape; @@ -59,6 +58,7 @@ static void testDodgeNeonDecoder(void) { assertEqualsM("trigger zero index", 8, getTheAngle(DODGE_NEON_1995)); EngineTestHelper eth(DODGE_NEON_1995); + EXPAND_EngineTestHelper; engine_configuration_s *ec = eth.ec; TriggerShape * shape = ð.engine.triggerShape; @@ -116,9 +116,7 @@ static void test1995FordInline6TriggerDecoder(void) { initTriggerDecoder(); EngineTestHelper eth(FORD_INLINE_6_1995); - - engine_configuration_s *engineConfiguration = eth.engine.engineConfiguration; - Engine *engine = ð.engine; + EXPAND_EngineTestHelper; TriggerShape * shape = ð.engine.triggerShape; @@ -181,9 +179,8 @@ void testFordAspire(void) { assertEquals(4, getTheAngle(FORD_ASPIRE_1996)); EngineTestHelper eth(FORD_ASPIRE_1996); + EXPAND_EngineTestHelper; - Engine *engine = ð.engine; - engine_configuration_s *engineConfiguration = eth.ec; assertEquals(4, eth.engine.triggerShape.getTriggerShapeSynchPointIndex()); assertEquals(800, engineConfiguration->fuelRpmBins[0]); @@ -209,9 +206,9 @@ void testMazdaMianaNbDecoder(void) { printf("*************************************************** testMazdaMianaNbDecoder\r\n"); EngineTestHelper eth(MAZDA_MIATA_NB); + EXPAND_EngineTestHelper; + engine_configuration_s *ec = eth.ec; - Engine *engine = ð.engine; - engine_configuration_s *engineConfiguration = ec; TriggerShape * shape = ð.engine.triggerShape; assertEquals(11, shape->getTriggerShapeSynchPointIndex()); @@ -294,9 +291,9 @@ static void testTriggerDecoder2(const char *msg, engine_type_e type, int synchPo printf("*************************************************** %s\r\n", msg); EngineTestHelper eth(type); + EXPAND_EngineTestHelper; + engine_configuration_s *ec = eth.ec; - engine_configuration_s * engineConfiguration = eth.engineConfiguration; - Engine *engine = ð.engine; initSpeedDensity(PASS_ENGINE_PARAMETER_F); @@ -321,12 +318,10 @@ extern int mockTps; static void testStartupFuelPumping(void) { EngineTestHelper eth(FORD_INLINE_6_1995); + EXPAND_EngineTestHelper; StartupFuelPumping sf; - Engine * engine = ð.engine; - engine_configuration_s *engineConfiguration = engine->engineConfiguration; - engine->rpmCalculator.mockRpm = 0; engine->engineConfiguration->tpsMin = 0; @@ -365,15 +360,13 @@ static void testRpmCalculator(void) { printf("*************************************************** testRpmCalculator\r\n"); EngineTestHelper eth(FORD_INLINE_6_1995); + EXPAND_EngineTestHelper; assertEquals(720, eth.engine.engineConfiguration->engineCycle); assertEquals(720, eth.ec->engineCycle); efiAssertVoid(eth.engine.engineConfiguration!=NULL, "null config in engine"); - Engine *engine = ð.engine; - engine_configuration_s *engineConfiguration = ð.persistentConfig.engineConfiguration; - initThermistors(NULL PASS_ENGINE_PARAMETER); engine->updateSlowSensors(); @@ -401,7 +394,7 @@ static void testRpmCalculator(void) { prepareTimingMap(PASS_ENGINE_PARAMETER_F); timeNow += 5000; // 5ms - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP PASS_ENGINE_PARAMETER); assertEqualsM("index #2", 0, eth.triggerCentral.triggerState.getCurrentIndex()); assertEqualsM("queue size", 6, schedulingQueue.size()); assertEqualsM("ev 1", 246444, schedulingQueue.getForUnitText(0)->momentX); @@ -409,11 +402,11 @@ static void testRpmCalculator(void) { schedulingQueue.clear(); timeNow += 5000; - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN PASS_ENGINE_PARAMETER); timeNow += 5000; // 5ms - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP PASS_ENGINE_PARAMETER); timeNow += 5000; - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN PASS_ENGINE_PARAMETER); assertEqualsM("index #3", 3, eth.triggerCentral.triggerState.getCurrentIndex()); assertEqualsM("queue size 3", 6, schedulingQueue.size()); assertEqualsM("ev 3", 259777, schedulingQueue.getForUnitText(0)->momentX); @@ -423,24 +416,24 @@ static void testRpmCalculator(void) { schedulingQueue.clear(); timeNow += 5000; - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN PASS_ENGINE_PARAMETER); timeNow += 5000; // 5ms - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP PASS_ENGINE_PARAMETER); timeNow += 5000; // 5ms - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP PASS_ENGINE_PARAMETER); assertEqualsM("index #4", 6, eth.triggerCentral.triggerState.getCurrentIndex()); assertEqualsM("queue size 4", 6, schedulingQueue.size()); assertEqualsM("4/0", 273111, schedulingQueue.getForUnitText(0)->momentX); schedulingQueue.clear(); timeNow += 5000; - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN PASS_ENGINE_PARAMETER); assertEqualsM("queue size 5", 0, schedulingQueue.size()); // assertEqualsM("5/1", 284500, schedulingQueue.getForUnitText(0)->momentUs); schedulingQueue.clear(); timeNow += 5000; // 5ms - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP PASS_ENGINE_PARAMETER); assertEqualsM("queue size 6", 6, schedulingQueue.size()); assertEqualsM("6/0", 286444, schedulingQueue.getForUnitText(0)->momentX); assertEqualsM("6/1", 285944, schedulingQueue.getForUnitText(1)->momentX); @@ -448,12 +441,12 @@ static void testRpmCalculator(void) { schedulingQueue.clear(); timeNow += 5000; - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN PASS_ENGINE_PARAMETER); assertEqualsM("queue size 7", 0, schedulingQueue.size()); schedulingQueue.clear(); timeNow += 5000; // 5ms - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP PASS_ENGINE_PARAMETER); assertEqualsM("queue size 8", 6, schedulingQueue.size()); assertEqualsM("8/0", 299777, schedulingQueue.getForUnitText(0)->momentX); assertEqualsM("8/1", 299277, schedulingQueue.getForUnitText(1)->momentX); @@ -462,12 +455,12 @@ static void testRpmCalculator(void) { schedulingQueue.clear(); timeNow += 5000; - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_DOWN PASS_ENGINE_PARAMETER); assertEqualsM("queue size 9", 0, schedulingQueue.size()); schedulingQueue.clear(); timeNow += 5000; // 5ms - eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP, ð.engine, eth.ec); + eth.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_UP PASS_ENGINE_PARAMETER); assertEqualsM("queue size 10", 0, schedulingQueue.size()); schedulingQueue.clear(); }