diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 79e7f06e2f..2ab01b11c1 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -153,6 +153,8 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat /** * that's NGC config */ + // set_cranking_fuel 5 + engineConfiguration->crankingSettings.baseCrankingFuel = 5; // set_whole_fuel_map 12 setWholeFuelMap(engineConfiguration, 12); diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 8fb437615f..d5dd6f2833 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -575,8 +575,6 @@ void applyNonPersistentConfiguration(Logging * logger, Engine *engine) { firmwareError("shaftPositionEventCount is zero"); return; } - - prepareShapes(engine); } void prepareShapes(Engine *engine) { diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 567beb7d10..97690eaaf2 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -383,6 +383,14 @@ void initEngineContoller(Engine *engine) { initInjectorCentral(engine); initPwmTester(); initIgnitionCentral(); + + /** + * This has to go after 'initInjectorCentral' and 'initInjectorCentral' in order to + * properly detect un-assigned output pins + */ + prepareShapes(engine); + + initMalfunctionCentral(); #if EFI_ELECTRONIC_THROTTLE_BODY diff --git a/unit_tests/engine_test_helper.cpp b/unit_tests/engine_test_helper.cpp index 8524c3733a..cac5900e2e 100644 --- a/unit_tests/engine_test_helper.cpp +++ b/unit_tests/engine_test_helper.cpp @@ -25,7 +25,8 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType) { initSpeedDensity(ec); - resetConfigurationExt(NULL, FORD_INLINE_6_1995, &engine); + resetConfigurationExt(NULL, engineType, &engine); + prepareShapes(&engine); engine.engineConfiguration->mafAdcChannel = (adc_channel_e)TEST_MAF_CHANNEL; } diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index 3580a623d4..5de1d77538 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -42,10 +42,7 @@ int getTheAngle(engine_type_e engineType) { EngineTestHelper eth(engineType); engine_configuration_s *ec = eth.ec; - - initDataStructures(ec); - resetConfigurationExt(NULL, engineType, ð.engine); trigger_shape_s * shape = ð.ec2.triggerShape; return findTriggerZeroEventIndex(shape, &ec->triggerConfig); @@ -60,8 +57,6 @@ static void testDodgeNeonDecoder(void) { EngineTestHelper eth(DODGE_NEON_1995); engine_configuration_s *ec = eth.ec; - - resetConfigurationExt(NULL, DODGE_NEON_1995, ð.engine); assertEquals(8, eth.ec2.triggerShape.getTriggerShapeSynchPointIndex()); trigger_shape_s * shape = ð.ec2.triggerShape; @@ -121,7 +116,6 @@ static void test1995FordInline6TriggerDecoder(void) { engine_configuration_s *engineConfiguration = eth.engine.engineConfiguration; Engine *engine = ð.engine; - resetConfigurationExt(NULL, FORD_INLINE_6_1995, ð.engine); assertEqualsM("triggerShapeSynchPointIndex", 0, eth.ec2.triggerShape.getTriggerShapeSynchPointIndex()); trigger_shape_s * shape = ð.ec2.triggerShape; @@ -185,7 +179,6 @@ void testFordAspire(void) { Engine *engine = ð.engine; engine_configuration_s *engineConfiguration = eth.ec; - resetConfigurationExt(NULL, FORD_ASPIRE_1996, engine); assertEquals(4, eth.ec2.triggerShape.getTriggerShapeSynchPointIndex()); assertEquals(800, engineConfiguration->fuelRpmBins[0]); @@ -204,9 +197,6 @@ void testMazda323(void) { printf("*************************************************** testMazda323\r\n"); EngineTestHelper eth(MAZDA_323); - persistent_config_s persistentConfig; - engine_configuration_s *ec = eth.ec; - resetConfigurationExt(NULL, MAZDA_323, ð.engine); assertEquals(0, eth.ec2.triggerShape.getTriggerShapeSynchPointIndex()); } @@ -217,7 +207,6 @@ void testMazdaMianaNbDecoder(void) { engine_configuration_s *ec = eth.ec; Engine *engine = ð.engine; engine_configuration_s *engineConfiguration = ec; - resetConfigurationExt(NULL, MAZDA_MIATA_NB, ð.engine); assertEquals(11, eth.ec2.triggerShape.getTriggerShapeSynchPointIndex()); TriggerState state; @@ -302,10 +291,7 @@ static void testTriggerDecoder2(const char *msg, engine_type_e type, int synchPo EngineTestHelper eth(type); engine_configuration_s *ec = eth.ec; - assertEquals(0, eth.ec2.triggerShape.getTriggerShapeSynchPointIndex()); - initSpeedDensity(ec); - resetConfigurationExt(NULL, type, ð.engine); assertEqualsM("synchPointIndex", synchPointIndex, eth.ec2.triggerShape.getTriggerShapeSynchPointIndex()); @@ -318,7 +304,6 @@ void testGY6_139QMB(void) { EngineTestHelper eth(GY6_139QMB); engine_configuration_s *ec = eth.ec; - resetConfigurationExt(NULL, GY6_139QMB, ð.engine); TriggerState state; assertFalseM("shaft_is_synchronized", state.shaft_is_synchronized); diff --git a/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp b/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp index d0e7e81153..43d6e6a9a7 100644 --- a/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp +++ b/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp @@ -72,6 +72,7 @@ void rusEfiFunctionalTest(void) { resetConfigurationExt(NULL, FORD_ASPIRE_1996, engine); + prepareShapes(engine); initThermistors(engine); initAlgo(engineConfiguration); @@ -87,7 +88,6 @@ void rusEfiFunctionalTest(void) { startStatusThreads(engine); startTunerStudioConnectivity(); - } void printPendingMessages(void) {