From 3b34c95c0160e4a7589c1b50f4627066dd5f1e60 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Mon, 24 Nov 2014 19:03:21 -0600 Subject: [PATCH] auto-sync --- firmware/controllers/algo/engine.h | 1 + firmware/controllers/trigger/main_trigger_callback.cpp | 5 +++-- firmware/rusefi.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 06fa2b41bf..6f1d51b407 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -54,6 +54,7 @@ public: */ bool isCylinderCleanupMode; + uint32_t beforeIgnitionMath; uint32_t ignitionMathTime; diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index b0c2e6b583..027d8385f5 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -328,7 +328,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex, Eng if (eventIndex == 0) { if (localVersion.isOld()) prepareOutputSignals(engine); - uint32_t beforeIgnitionMath = GET_TIMESTAMP(); + engine->beforeIgnitionMath = GET_TIMESTAMP(); /** * TODO: warning. there is a bit of a hack here, todo: improve. @@ -343,6 +343,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex, Eng * todo: one day we can control cylinders individually */ float dwellMs = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER); + if (cisnan(dwellMs) || dwellMs < 0) { firmwareError("invalid dwell: %f at %d", dwellMs, rpm); return; @@ -370,7 +371,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex, Eng initializeIgnitionActions(-advance, dwellAngle, &engine->engineConfiguration2->ignitionEvents[revolutionIndex] PASS_ENGINE_PARAMETER); - engine->ignitionMathTime = GET_TIMESTAMP() - beforeIgnitionMath; + engine->ignitionMathTime = GET_TIMESTAMP() - engine->beforeIgnitionMath; } triggerEventsQueue.executeAll(getCrankEventCounter()); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 7ef29502a7..eac89f13d4 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -258,7 +258,7 @@ void firmwareError(const char *fmt, ...) { static char UNUSED_RAM_SIZE[10000]; -static char UNUSED_CCM_SIZE[15000] CCM_OPTIONAL; +static char UNUSED_CCM_SIZE[11000] CCM_OPTIONAL; int getRusEfiVersion(void) { if (UNUSED_RAM_SIZE == 0)