From 8782c80749ef83c1e972be83ea8828da851a41b7 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 9 Feb 2017 12:03:46 -0500 Subject: [PATCH] auto-sync --- firmware/console/status_loop.cpp | 5 +++-- firmware/controllers/algo/advance_map.cpp | 2 +- firmware/controllers/algo/engine.cpp | 1 + firmware/controllers/algo/engine.h | 3 +++ firmware/controllers/algo/rusefi_enums.h | 6 +++--- firmware/hw_layer/vehicle_speed.cpp | 5 ++--- firmware/integration/rusefi_config.txt | 2 +- firmware/rusefi.cpp | 2 +- firmware/tunerstudio/rusefi.ini | 4 ++-- hardware/frankenso/known_issues.txt | 1 + java_console/models/src/com/rusefi/config/Fields.java | 4 ++-- 11 files changed, 20 insertions(+), 15 deletions(-) diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index b8e035d904..d69b7db0d4 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -706,7 +706,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->debugIntField1 = engine->tpsAccelEnrichment.cb.getSize(); } - if (engineConfiguration->debugMode == TRIGGER_COUNT) { + if (engineConfiguration->debugMode == DBG_TRIGGER_INPUT) { tsOutputChannels->debugIntField1 = engine->triggerCentral.getHwEventCounter(0); tsOutputChannels->debugIntField2 = engine->triggerCentral.getHwEventCounter(1); tsOutputChannels->debugIntField3 = engine->triggerCentral.getHwEventCounter(2); @@ -716,7 +716,8 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ strcpy(buf, "adcX"); tsOutputChannels->debugFloatField1 = getVoltage("fsio", engineConfiguration->fsioAdc[0]); } - + } else if (engineConfiguration->debugMode == DBG_VEHICLE_SPEED_SENSOR) { + tsOutputChannels->debugIntField1 = engine->engineState.vssCounter; } tsOutputChannels->wallFuelAmount = ENGINE(wallFuel).getWallFuel(0); diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index 541c7759af..9dbc82dcc4 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -84,7 +84,7 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME } else { iatCorrection = iatAdvanceCorrectionMap.getValue((float) rpm, engine->engineState.iat); } - if (engineConfiguration->debugMode == DBG_TIMING) { + if (engineConfiguration->debugMode == DBG_IGNITION_TIMING) { #if !EFI_UNIT_TEST || defined(__DOXYGEN__) tsOutputChannels.debugFloatField1 = iatCorrection; tsOutputChannels.debugFloatField2 = engine->engineState.cltTimingCorrection; diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 4099bd7505..14baed11a7 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -136,6 +136,7 @@ EngineState::EngineState() { lastErrorCode = 0; crankingTime = 0; timeSinceCranking = 0; + vssCounter = 0; targetAFR = 0; tpsAccelEnrich = 0; tChargeK = 0; diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index e71169f3d9..5316fc1c84 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -150,6 +150,9 @@ public: float currentAfr; + int vssCounter; + + /** * pre-calculated value from simple fuel lookup */ diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 4b58da0dcf..0380504efa 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -649,14 +649,14 @@ typedef enum { WARMUP_ENRICH = 2, IDLE = 3, DBG_EL_ACCEL = 4, - TRIGGER_COUNT = 5, + DBG_TRIGGER_INPUT = 5, FSIO_ADC = 6, AUX_PID_1 = 7, DBG_VVT = 8, DBG_POST_CRANKING_ENRICH = 9, - DBG_TIMING = 10, + DBG_IGNITION_TIMING = 10, DBG_FUEL_PID_CORRECTION = 11, - DM_12 = 12, + DBG_VEHICLE_SPEED_SENSOR = 12, DM_13 = 13, DM_14 = 14, DM_15 = 15, diff --git a/firmware/hw_layer/vehicle_speed.cpp b/firmware/hw_layer/vehicle_speed.cpp index be3d3f3da1..e79dd1cbf0 100644 --- a/firmware/hw_layer/vehicle_speed.cpp +++ b/firmware/hw_layer/vehicle_speed.cpp @@ -20,7 +20,6 @@ static Logging *logger; static efitick_t lastSignalTimeNt = 0; static efitick_t vssDiff = 0; -static int vssCounter = 0; #define DEFAULT_MOCK_SPEED -1 static float mockVehicleSpeed = DEFAULT_MOCK_SPEED; // in kilometers per hour @@ -45,7 +44,7 @@ float getVehicleSpeed(void) { } static void vsAnaWidthCallback(void) { - vssCounter++; + engine->engineState.vssCounter++; efitick_t nowNt = getTimeNowNt(); vssDiff = nowNt - lastSignalTimeNt; lastSignalTimeNt = nowNt; @@ -57,7 +56,7 @@ static void speedInfo(void) { scheduleMsg(logger, "c=%f eventCounter=%d speed=%f", engineConfiguration->vehicleSpeedCoef, - vssCounter, + engine->engineState.vssCounter, getVehicleSpeed()); scheduleMsg(logger, "vss diff %d", vssDiff); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index b7f83e23ae..e0b0fcf272 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -109,7 +109,7 @@ float baseFuel;+Fuel squirt duration while cranking\nA number of curves adjust t int16_t rpm;+Cranking mode threshold. Special cranking logic controls fuel and spark while RPM is below this threshold\nset cranking_rpm X;"RPM", 1, 0, 0, 3000, 0 end_struct -#define debug_mode_e_enum "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT", "Post-crank enrich", "Timing", "Closed-loop fuel corr", "mode12", "mode13", "mode14", "mode15" +#define debug_mode_e_enum "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT", "Post-crank enrich", "Timing", "Closed-loop fuel corr", "VSS", "mode13", "mode14", "mode15" custom debug_mode_e 4 bits, U32, @OFFSET@, [0:3], @@debug_mode_e_enum@@ #define vvt_mode_e_enum "First half", "Second half", "2GZ", "Miata NB2", "mode4", "mode5", "mode6", "mode7" diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index ae70a5f57e..b038f77243 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -249,5 +249,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 20170208; + return 20170209; } diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index c4d938b8d8..ca5865ad3a 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -42,7 +42,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Wed Feb 08 00:14:53 EST 2017 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Feb 09 11:38:10 EST 2017 pageSize = 16376 page = 1 @@ -554,7 +554,7 @@ page = 1 tpsDecelEnleanmentThreshold = scalar, F32, 2232, "roc", 1, 0, 0, 200, 3 tpsDecelEnleanmentMultiplier = scalar, F32, 2236, "coeff", 1, 0, 0, 200, 3 slowAdcAlpha = scalar, F32, 2240, "coeff", 1, 0, 0, 200, 3 - debugMode = bits, U32, 2244, [0:3], "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT", "Post-crank enrich", "Timing", "Closed-loop fuel corr", "mode12", "mode13", "mode14", "mode15" + debugMode = bits, U32, 2244, [0:3], "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT", "Post-crank enrich", "Timing", "Closed-loop fuel corr", "VSS", "mode13", "mode14", "mode15" warmupAfrPid_pFactor = scalar, F32, 2248, "value", 1, 0, -1000, 1000, 5 warmupAfrPid_iFactor = scalar, F32, 2252, "value", 1, 0, -1000, 1000, 5 warmupAfrPid_dFactor = scalar, F32, 2256, "value", 1, 0, -1000, 1000, 5 diff --git a/hardware/frankenso/known_issues.txt b/hardware/frankenso/known_issues.txt index f9fe5c37e3..2abff4af54 100644 --- a/hardware/frankenso/known_issues.txt +++ b/hardware/frankenso/known_issues.txt @@ -129,6 +129,7 @@ 129) silkscreen not under but next to component: R1001 R1002 D1001 etc? 130) C472, C354 and C358 are electrolytic in the schematic 131) between items #111, #127 and #128 we should keep stepper motor in mind and ideally have a space to mount it with minimal wiring +132) Add vias to PE5 & PE6 traces (these are input capture options on TIM9) For honda add-on / rewiring board -- Add 2A high side solinoid drive for VTec sol diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 2ef7038135..ca76aceda5 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Feb 06 18:33:11 EST 2017 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Feb 09 11:38:10 EST 2017 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int FSIO_ADC_COUNT = 4; @@ -1507,7 +1507,7 @@ public class Fields { public static final Field TPSDECELENLEANMENTTHRESHOLD = Field.create("TPSDECELENLEANMENTTHRESHOLD", 2232, FieldType.FLOAT); public static final Field TPSDECELENLEANMENTMULTIPLIER = Field.create("TPSDECELENLEANMENTMULTIPLIER", 2236, FieldType.FLOAT); public static final Field SLOWADCALPHA = Field.create("SLOWADCALPHA", 2240, FieldType.FLOAT); - public static final String[] debug_mode_e = {"Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT", "Post-crank enrich", "Timing", "Closed-loop fuel corr", "mode12", "mode13", "mode14", "mode15"}; + public static final String[] debug_mode_e = {"Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT", "Post-crank enrich", "Timing", "Closed-loop fuel corr", "VSS", "mode13", "mode14", "mode15"}; public static final Field DEBUGMODE = Field.create("DEBUGMODE", 2244, FieldType.INT, debug_mode_e); public static final Field WARMUPAFRPID_PFACTOR = Field.create("WARMUPAFRPID_PFACTOR", 2248, FieldType.FLOAT); public static final Field WARMUPAFRPID_IFACTOR = Field.create("WARMUPAFRPID_IFACTOR", 2252, FieldType.FLOAT);