From 81570e5857beaca09c6994d9826071ced6890a7d Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 1 Nov 2016 09:02:29 -0400 Subject: [PATCH] auto-sync --- firmware/controllers/system/efiGpio.cpp | 9 +++++++++ firmware/controllers/system/efiGpio.h | 1 + unit_tests/engine_test_helper.cpp | 7 +------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/firmware/controllers/system/efiGpio.cpp b/firmware/controllers/system/efiGpio.cpp index d88571b0ba..8c52af0fdb 100644 --- a/firmware/controllers/system/efiGpio.cpp +++ b/firmware/controllers/system/efiGpio.cpp @@ -49,6 +49,15 @@ engine_pins_s::engine_pins_s() { } } +void engine_pins_s::reset() { + for (int i = 0; i < INJECTION_PIN_COUNT;i++) { + injectors[i].reset(); + } + for (int i = 0; i < IGNITION_PIN_COUNT;i++) { + coils[i].reset(); + } +} + void InjectorOutputPin::reset() { overlappingScheduleOffTime = 0; cancelNextTurningInjectorOff = false; diff --git a/firmware/controllers/system/efiGpio.h b/firmware/controllers/system/efiGpio.h index 1dd6023844..9084dc0484 100644 --- a/firmware/controllers/system/efiGpio.h +++ b/firmware/controllers/system/efiGpio.h @@ -66,6 +66,7 @@ public: class engine_pins_s { public: engine_pins_s(); + void reset(); OutputPin mainRelay; OutputPin fanRelay; OutputPin acRelay; diff --git a/unit_tests/engine_test_helper.cpp b/unit_tests/engine_test_helper.cpp index 8d5fdc348c..6250672eb9 100644 --- a/unit_tests/engine_test_helper.cpp +++ b/unit_tests/engine_test_helper.cpp @@ -20,12 +20,7 @@ extern engine_pins_s enginePins; EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persistentConfig) { ec = &persistentConfig.engineConfiguration; - for (int i = 0; i < INJECTION_PIN_COUNT;i++) { - enginePins.injectors[i].reset(); - } - for (int i = 0; i < IGNITION_PIN_COUNT;i++) { - enginePins.coils[i].reset(); - } + enginePins.reset(); engineConfiguration = ec; board_configuration_s * boardConfiguration = &engineConfiguration->bc;