diff --git a/firmware/hw_layer/trigger_input.cpp b/firmware/hw_layer/trigger_input.cpp index ae2642f7eb..ed83d85e9e 100644 --- a/firmware/hw_layer/trigger_input.cpp +++ b/firmware/hw_layer/trigger_input.cpp @@ -75,6 +75,12 @@ static ICUDriver *turnOnTriggerInputPin(brain_pin_e hwPin) { scheduleMsg(logger, "turnOnTriggerInputPin %s", hwPortname(hwPin)); // todo: reuse 'setWaveReaderMode' method here? if (driver != NULL) { + bool_t needWidthCallback = !CONFIG(useOnlyFrontForTrigger) || TRIGGER_SHAPE(useRiseEdge); + shaft_icucfg.width_cb = needWidthCallback ? shaft_icu_width_callback : NULL; + + bool_t needPeriodCallback = !CONFIG(useOnlyFrontForTrigger) || !TRIGGER_SHAPE(useRiseEdge); + shaft_icucfg.width_cb = needPeriodCallback ? shaft_icu_period_callback : NULL; + efiIcuStart(driver, &shaft_icucfg); icuEnable(driver); } diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 8bd02a4421..49ca3e2b13 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -290,5 +290,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20150409; + return 20150410; } diff --git a/java_console/autotest/src/com/rusefi/TestingUtils.java b/java_console/autotest/src/com/rusefi/TestingUtils.java index 76d869e89e..37e8cf85a7 100644 --- a/java_console/autotest/src/com/rusefi/TestingUtils.java +++ b/java_console/autotest/src/com/rusefi/TestingUtils.java @@ -78,8 +78,8 @@ public class TestingUtils { if (isRealHardware) return; RevolutionLog revolutionLog = chart.getRevolutionsLog(); - if (revolutionLog.keySet().isEmpty()) - throw new IllegalStateException(msg + " Empty revolutions in " + chart); + if (revolutionLog.getSize() < 2) + throw new IllegalStateException(msg + " Not many revolutions in " + chart); StringBuilder events = chart.get(key); assertTrue(msg + " Events not null for " + key, events != null); diff --git a/java_console/models/src/com/rusefi/waves/RevolutionLog.java b/java_console/models/src/com/rusefi/waves/RevolutionLog.java index 7448014e48..e036144124 100644 --- a/java_console/models/src/com/rusefi/waves/RevolutionLog.java +++ b/java_console/models/src/com/rusefi/waves/RevolutionLog.java @@ -30,6 +30,10 @@ public class RevolutionLog { return new RevolutionLog(time2rpm); } + public int getSize() { + return time2rpm.size(); + } + public String getCrankAngleByTimeString(double time) { double result = getCrankAngleByTime(time); return Double.isNaN(result) ? "n/a" : String.format("%.2f", result);