From 2621853e0d435488098bd31200aa9dd1a7020095 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sun, 22 Mar 2015 14:04:59 -0500 Subject: [PATCH] auto-sync --- firmware/config/engines/sachs.cpp | 3 ++- firmware/controllers/algo/engine_configuration.h | 1 - firmware/controllers/trigger/trigger_central.cpp | 6 +++--- firmware/controllers/trigger/trigger_decoder.cpp | 2 +- firmware/controllers/trigger/trigger_structure.cpp | 2 +- java_console/autotest/src/com/rusefi/TestingUtils.java | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/firmware/config/engines/sachs.cpp b/firmware/config/engines/sachs.cpp index 2707985e5d..9d215b35db 100644 --- a/firmware/config/engines/sachs.cpp +++ b/firmware/config/engines/sachs.cpp @@ -17,8 +17,9 @@ void setSachs(engine_configuration_s *engineConfiguration) { engineConfiguration->specs.cylindersCount = 1; engineConfiguration->engineCycle = 360; -// setOperationMode(engineConfiguration, TWO_STROKE); + setOperationMode(engineConfiguration, TWO_STROKE); engineConfiguration->specs.firingOrder = FO_ONE_CYLINDER; + engineConfiguration->digitalChartSize = 400; /** * We treat the trigger as 1/0 toothed wheel diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index a193980b3c..4aa0bcf0c0 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -37,7 +37,6 @@ float getRpmMultiplier(operation_mode_e mode); void setOperationMode(engine_configuration_s *engineConfiguration, operation_mode_e mode); -operation_mode_e getOperationMode(engine_configuration_s const *engineConfiguration); typedef struct { engine_configuration_s engineConfiguration; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 18fc89f155..260c9d4ba4 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -169,11 +169,11 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PAR } /** - * If we only have a crank position sensor, here we are extending crank revolutions with a 360 degree - * cycle into a four stroke, 720 degrees cycle. TODO + * If we only have a crank position sensor with four stroke, here we are extending crank revolutions with a 360 degree + * cycle into a four stroke, 720 degrees cycle. */ int triggerIndexForListeners; - if (getOperationMode(engine->engineConfiguration) == FOUR_STROKE_CAM_SENSOR) { + if (engineConfiguration->operationMode != FOUR_STROKE_CRANK_SENSOR) { // That's easy - trigger cycle matches engine cycle triggerIndexForListeners = triggerState.getCurrentIndex(); } else { diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 1f031cb83a..8466fe86a4 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -290,7 +290,7 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin case TT_TOOTHED_WHEEL: initializeSkippedToothTriggerShapeExt(triggerShape, triggerConfig->customTotalToothCount, - triggerConfig->customSkippedToothCount, getOperationMode(engineConfiguration)); + triggerConfig->customSkippedToothCount, engineConfiguration->operationMode); break; case TT_MAZDA_MIATA_NA: diff --git a/firmware/controllers/trigger/trigger_structure.cpp b/firmware/controllers/trigger/trigger_structure.cpp index 4dde2666cc..6a15ae296a 100644 --- a/firmware/controllers/trigger/trigger_structure.cpp +++ b/firmware/controllers/trigger/trigger_structure.cpp @@ -297,7 +297,7 @@ void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped, s->useRiseEdge = true; initializeSkippedToothTriggerShapeExt(s, total, skipped, - getOperationMode(engineConfiguration)); + engineConfiguration->operationMode); #endif } diff --git a/java_console/autotest/src/com/rusefi/TestingUtils.java b/java_console/autotest/src/com/rusefi/TestingUtils.java index e2daca5834..20964c6532 100644 --- a/java_console/autotest/src/com/rusefi/TestingUtils.java +++ b/java_console/autotest/src/com/rusefi/TestingUtils.java @@ -112,7 +112,7 @@ public class TestingUtils { // we need to skip TWO because spark could have been scheduled a while ago and happen now // todo: improve this logic, compare times IoUtil.sendCommand("reset_wave_chart"); - getWaveChart(); +// getWaveChart(); // we want to wait for the 2nd chart to see same same RPM across the whole chart String result = getWaveChart(); FileLog.MAIN.logLine("current chart: " + result);