diff --git a/firmware/config/engines/test_engine.cpp b/firmware/config/engines/test_engine.cpp index f1b8fb5d18..0756dc5746 100644 --- a/firmware/config/engines/test_engine.cpp +++ b/firmware/config/engines/test_engine.cpp @@ -72,6 +72,6 @@ void setTestVVTEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->globalTriggerAngleOffset = 0; engineConfiguration->vvtMode = VVT_SECOND_HALF; - engineConfiguration->debugMode = VVT; + engineConfiguration->debugMode = DBG_VVT; } diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index fc1383d048..e438fcefea 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -109,11 +109,11 @@ floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) { float tpsFrom = cb.get(index - 1); float d = tpsTo - tpsFrom; - float deltaMult = tpsTpsMap.getValue(tpsFrom, tpsTo); + float valueFromTable = tpsTpsMap.getValue(tpsFrom, tpsTo); floatms_t extraFuel; if (d > engineConfiguration->tpsAccelEnrichmentThreshold) { - extraFuel = deltaMult; + extraFuel = valueFromTable; } else if (d < -engineConfiguration->tpsDecelEnleanmentThreshold) { extraFuel = d * engineConfiguration->tpsDecelEnleanmentMultiplier; } else { @@ -124,7 +124,7 @@ floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) { if (engineConfiguration->debugMode == DBG_TPS_ACCEL) { tsOutputChannels.debugFloatField1 = tpsFrom; tsOutputChannels.debugFloatField2 = tpsTo; - tsOutputChannels.debugFloatField3 = deltaMult; + tsOutputChannels.debugFloatField3 = valueFromTable; tsOutputChannels.debugFloatField4 = extraFuel; } #endif diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index a5b1703963..5a5981cde4 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -676,7 +676,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->isWaveAnalyzerEnabled = true; engineConfiguration->isIdleThreadEnabled = true; - engineConfiguration->debugMode = ALTERNATOR; + engineConfiguration->debugMode = ALTERNATOR_PID; engineConfiguration->acIdleRpmBump = 200; engineConfiguration->knockDetectionWindowStart = 35; diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 595b78e674..12010b1150 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -600,7 +600,7 @@ typedef enum { } brain_pin_e; typedef enum { - ALTERNATOR = 0, + ALTERNATOR_PID = 0, DBG_TPS_ACCEL = 1, WARMUP_ENRICH = 2, IDLE = 3, @@ -608,7 +608,7 @@ typedef enum { TRIGGER_COUNT = 5, FSIO_ADC = 6, AUX_PID_1 = 7, - VVT = 8, + DBG_VVT = 8, DM_9 = 9, DM_10 = 10, DM_11 = 11, diff --git a/firmware/controllers/alternatorController.cpp b/firmware/controllers/alternatorController.cpp index 499ad8bb0f..c8d14a4394 100644 --- a/firmware/controllers/alternatorController.cpp +++ b/firmware/controllers/alternatorController.cpp @@ -75,7 +75,7 @@ static msg_t AltCtrlThread(int param) { bool newState = (vBatt < targetVoltage - h) || (currentPlainOnOffState && vBatt < targetVoltage); enginePins.alternatorPin.setValue(newState); currentPlainOnOffState = newState; - if (engineConfiguration->debugMode == ALTERNATOR) { + if (engineConfiguration->debugMode == ALTERNATOR_PID) { tsOutputChannels.debugIntField1 = newState; } @@ -91,7 +91,7 @@ static msg_t AltCtrlThread(int param) { } #if ! EFI_UNIT_TEST || defined(__DOXYGEN__) - if (engineConfiguration->debugMode == ALTERNATOR) { + if (engineConfiguration->debugMode == ALTERNATOR_PID) { tsOutputChannels.debugFloatField1 = currentAltDuty; altPid.postState(&tsOutputChannels); } diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 37b2557049..879ebf52ad 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -108,7 +108,7 @@ void hwHandleVvtCamSignal(trigger_value_e front) { */ tc->triggerState.intTotalEventCounter(); #if EFI_PROD_CODE || defined(__DOXYGEN__) - if (engineConfiguration->debugMode == VVT) { + if (engineConfiguration->debugMode == DBG_VVT) { tsOutputChannels.debugIntField1++; } #endif /* EFI_PROD_CODE */ @@ -119,7 +119,7 @@ void hwHandleVvtCamSignal(trigger_value_e front) { // see above comment #if EFI_PROD_CODE || defined(__DOXYGEN__) tc->triggerState.intTotalEventCounter(); - if (engineConfiguration->debugMode == VVT) { + if (engineConfiguration->debugMode == DBG_VVT) { tsOutputChannels.debugIntField1++; } #endif /* EFI_PROD_CODE */ diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index c63f6986c3..fe2e28770e 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", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT", "mode9", "mode10", "mode11", "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", "mode9", "mode10", "mode11", "mode12", "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", "mode3" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index f79221cc09..cec3acdef6 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1232,10 +1232,18 @@ fileVersion = { 20160702 } entry = sparkDwellValue, "dwell", float,"%.3f" - + entry = debugMode, "debugMode",int,"%d" +; Alternator_PID: alternator duty cycle +; DBG_TPS_ACCEL: from TPS entry = debugFloatField1, "debug f1",float,"%.4f" + +; DBG_TPS_ACCEL: to TPS entry = debugFloatField2, "debug f2",float,"%.4f" + +; DBG_TPS_ACCEL: tps<>tps table value entry = debugFloatField3, "debug f3",float,"%.4f" + +; DBG_TPS_ACCEL: extra fuel entry = debugFloatField4, "debug f4",float,"%.4f" entry = debugFloatField5, "debug f5",float,"%.4f" entry = debugIntField1, "debug i1",int,"%d" diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 9d9fa6f5d4..dd42680ba6 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 Sat Sep 17 14:41:13 EDT 2016 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Sep 17 18:26:30 EDT 2016 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int FSIO_ADC_COUNT = 4; @@ -1465,7 +1465,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", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT", "mode9", "mode10", "mode11", "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", "mode9", "mode10", "mode11", "mode12", "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);