From 9beef0f0ae4acd42faa75a7b0aa593c5729dcc67 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 10 Jul 2017 21:47:51 -0400 Subject: [PATCH] refactoring: OOP --- firmware/controllers/math/engine_math.cpp | 2 +- firmware/controllers/trigger/spark_logic.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index 0ef3368714..1f5fc8a36f 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -177,7 +177,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFF InjectorOutputPin *output = &enginePins.injectors[index]; - if (!isSimultanious && !isPinAssigned(output)) { + if (!isSimultanious && !output->isInitialized()) { // todo: extract method for this index math warning(CUSTOM_OBD_INJECTION_NO_PIN_ASSIGNED, "no_pin_inj #%s", output->name); } diff --git a/firmware/controllers/trigger/spark_logic.cpp b/firmware/controllers/trigger/spark_logic.cpp index 2c994c8fa8..bc7e834d2d 100644 --- a/firmware/controllers/trigger/spark_logic.cpp +++ b/firmware/controllers/trigger/spark_logic.cpp @@ -211,12 +211,11 @@ static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t trgEventI } #define assertPinAssigned(output) { \ - if (!isPinAssigned(output)) { \ + if (!output->isInitialized()) { \ warning(CUSTOM_OBD_COIL_PIN_NOT_ASSIGNED, "no_pin_cl #%s", (output)->name); \ } \ } - void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_SUFFIX) { // todo: clean up this implementation? does not look too nice as is.