From ec3fd7ba25a3e3892ec437cc477db953dfacbc81 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sun, 12 Jun 2016 16:01:41 -0400 Subject: [PATCH] auto-sync --- .../controllers/trigger/main_trigger_callback.cpp | 13 ++++++++++--- firmware/svnversion.h | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index 1dd210dc34..496a564ac1 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -388,6 +388,8 @@ static ALWAYS_INLINE void scheduleIgnitionAndFuelEvents(int rpm, int revolutionI * Both injection and ignition are controlled from this method. */ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex DECLARE_ENGINE_PARAMETER_S) { + (void) ckpSignalType; + ENGINE(m.beforeMainTrigger) = GET_TIMESTAMP(); if (hasFirmwareError()) { /** @@ -396,11 +398,16 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex DECL */ return; } - - (void) ckpSignalType; - efiAssertVoid(eventIndex < 2 * engine->triggerShape.getSize(), "trigger/event index"); efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#2"); + if (eventIndex >= ENGINE(triggerShape.getLength())) { + /** + * this could happen in case of a trigger error, just exit silently since the trigger error is supposed to be handled already + * todo: should this check be somewhere higher so that no trigger listeners are invoked with noise? + */ + return; + } + int rpm = ENGINE(rpmCalculator.rpmValue); if (rpm == 0) { // this happens while we just start cranking diff --git a/firmware/svnversion.h b/firmware/svnversion.h index 4e07d278c8..bac9bf0711 100644 --- a/firmware/svnversion.h +++ b/firmware/svnversion.h @@ -1,5 +1,5 @@ // This file was generated by Version2Header -// Sun Jun 12 10:45:07 EDT 2016 +// Sun Jun 12 15:11:11 EDT 2016 #ifndef VCS_VERSION -#define VCS_VERSION "10001" +#define VCS_VERSION "10013" #endif