From 20452c51f839374b7dc3f2d316ccebe631a83e85 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Mon, 28 Nov 2016 23:02:02 -0500 Subject: [PATCH] auto-sync --- firmware/controllers/trigger/spark_logic.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/trigger/spark_logic.cpp b/firmware/controllers/trigger/spark_logic.cpp index a2c313fee9..1a6320d8fd 100644 --- a/firmware/controllers/trigger/spark_logic.cpp +++ b/firmware/controllers/trigger/spark_logic.cpp @@ -30,6 +30,8 @@ int isIgnitionTimingError(void) { return ignitionErrorDetection.sum(6) > 4; } +void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_S); + static void turnSparkPinLow2(IgnitionEvent *event, IgnitionOutputPin *output) { #if SPARK_EXTREME_LOGGING || defined(__DOXYGEN__) scheduleMsg(logger, "spark goes low %d %s %d current=%d cnt=%d id=%d", getRevolutionCounter(), output->name, (int)getTimeNowUs(), @@ -221,7 +223,7 @@ static void addIgnitionEvent(angle_t localAdvance, angle_t dwellAngle, IgnitionE } -static void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_S) { +void prepareIgnitionSchedule(IgnitionEvent *event DECLARE_ENGINE_PARAMETER_S) { // todo: clean up this implementation? does not look too nice as is. // change of sign here from 'before TDC' to 'after TDC' @@ -247,6 +249,9 @@ static void initializeIgnitionActions(IgnitionEventList *list DECLARE_ENGINE_PAR for (int cylinderIndex = 0; cylinderIndex < CONFIG(specs.cylindersCount); cylinderIndex++) { list->elements[cylinderIndex].cylinderIndex = cylinderIndex; +#if EFI_UNIT_TEST + list->elements[cylinderIndex].engine = engine; +#endif prepareIgnitionSchedule(&list->elements[cylinderIndex] PASS_ENGINE_PARAMETER); } list->isReady = true;