From fd2cc73d481d227e338e4d63f9edd9be350cde43 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 31 Dec 2015 18:02:17 -0500 Subject: [PATCH] auto-sync --- .../controllers/algo/accel_enrichment.cpp | 43 +++++++++++++------ firmware/controllers/algo/accel_enrichment.h | 5 ++- ...ngine_configuration_generated_structures.h | 20 ++++++--- firmware/controllers/algo/rusefi_generated.h | 10 +++-- firmware/integration/rusefi_config.txt | 12 +++--- .../models/src/com/rusefi/config/Fields.java | 8 ++-- 6 files changed, 66 insertions(+), 32 deletions(-) diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index f450e62c7a..d2a7d8a6e4 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -116,9 +116,9 @@ AccelEnrichmemnt::AccelEnrichmemnt() { #if ! EFI_UNIT_TEST || defined(__DOXYGEN__) static void accelInfo() { -// scheduleMsg(logger, "MAP accel length=%d", mapInstance.cb.getSize()); - scheduleMsg(logger, "MAP accel th=%f/mult=%f", engineConfiguration->engineLoadAccelEnrichmentThreshold, engineConfiguration->engineLoadAccelEnrichmentMultiplier); - scheduleMsg(logger, "MAP decel th=%f/mult=%f", engineConfiguration->decelEnleanmentThreshold, engineConfiguration->decelEnleanmentMultiplier); +// scheduleMsg(logger, "EL accel length=%d", mapInstance.cb.getSize()); + scheduleMsg(logger, "EL accel th=%f/mult=%f", engineConfiguration->engineLoadAccelEnrichmentThreshold, engineConfiguration->engineLoadAccelEnrichmentMultiplier); + scheduleMsg(logger, "EL decel th=%f/mult=%f", engineConfiguration->engineLoadDecelEnleanmentThreshold, engineConfiguration->engineLoadDecelEnleanmentMultiplier); // scheduleMsg(logger, "TPS accel length=%d", tpsInstance.cb.getSize()); scheduleMsg(logger, "TPS accel th=%f/mult=%f", engineConfiguration->tpsAccelEnrichmentThreshold, engineConfiguration->tpsAccelEnrichmentMultiplier); @@ -126,12 +126,12 @@ static void accelInfo() { scheduleMsg(logger, "added to wall=%f/sucked=%f", engineConfiguration->addedToWallCoef, engineConfiguration->suckedOffCoef); } -static void setengineLoadAccelThr(float value) { +void setEngineLoadAccelThr(float value) { engineConfiguration->engineLoadAccelEnrichmentThreshold = value; accelInfo(); } -static void setengineLoadAccelMult(float value) { +void setEngineLoadAccelMult(float value) { engineConfiguration->engineLoadAccelEnrichmentMultiplier = value; accelInfo(); } @@ -146,13 +146,23 @@ static void setTpsAccelMult(float value) { accelInfo(); } +static void setTpsDecelThr(float value) { + engineConfiguration->tpsDecelEnleanmentThreshold = value; + accelInfo(); +} + +static void setTpsDecelMult(float value) { + engineConfiguration->tpsDecelEnleanmentMultiplier = value; + accelInfo(); +} + static void setDecelThr(float value) { - engineConfiguration->decelEnleanmentThreshold = value; + engineConfiguration->engineLoadDecelEnleanmentThreshold = value; accelInfo(); } static void setDecelMult(float value) { - engineConfiguration->decelEnleanmentMultiplier = value; + engineConfiguration->engineLoadDecelEnleanmentMultiplier = value; accelInfo(); } @@ -165,7 +175,7 @@ static void setTpsAccelLen(int len) { accelInfo(); } -static void setengineLoadAccelLen(int len) { +void setEngineLoadAccelLen(int len) { if (len < 1) { scheduleMsg(logger, "Length should be positive"); return; @@ -179,15 +189,20 @@ void initAccelEnrichment(Logging *sharedLogger) { addConsoleActionI("set_tps_accel_len", setTpsAccelLen); addConsoleActionF("set_tps_accel_threshold", setTpsAccelThr); addConsoleActionF("set_tps_accel_multiplier", setTpsAccelMult); + addConsoleActionF("set_tps_decel_threshold", setTpsDecelThr); + addConsoleActionF("set_tps_decel_multiplier", setTpsDecelMult); - addConsoleActionI("set_map_accel_len", setengineLoadAccelLen); - addConsoleActionF("set_map_accel_threshold", setengineLoadAccelThr); - addConsoleActionF("set_map_accel_multiplier", setengineLoadAccelMult); - addConsoleActionF("set_decel_threshold", setDecelThr); - addConsoleActionF("set_decel_multiplier", setDecelMult); + addConsoleActionI("set_engine_load_accel_len", setEngineLoadAccelLen); + addConsoleActionF("set_engine_load_accel_threshold", setEngineLoadAccelThr); + addConsoleActionF("set_engine_load_accel_multiplier", setEngineLoadAccelMult); + addConsoleActionF("set_engine_decel_threshold", setDecelThr); + addConsoleActionF("set_engine_decel_multiplier", setDecelMult); addConsoleAction("accelinfo", accelInfo); - setengineLoadAccelLen(engineConfiguration->engineLoadAccelLength); + /** + * This would initialize data structures + */ + setEngineLoadAccelLen(engineConfiguration->engineLoadAccelLength); setTpsAccelLen(engineConfiguration->tpsAccelLength); } #endif /* ! EFI_UNIT_TEST */ diff --git a/firmware/controllers/algo/accel_enrichment.h b/firmware/controllers/algo/accel_enrichment.h index 3dd19a56ed..80c18a5759 100644 --- a/firmware/controllers/algo/accel_enrichment.h +++ b/firmware/controllers/algo/accel_enrichment.h @@ -54,7 +54,10 @@ private: }; void initAccelEnrichment(Logging *sharedLogger); -float getAccelEnrichment(void); + +void setEngineLoadAccelLen(int len); +void setEngineLoadAccelThr(float value); +void setEngineLoadAccelMult(float value); #endif /* ACC_ENRICHMENT_H_ */ diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 85507aa8ad..8772197892 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Dec 31 12:46:57 EST 2015 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Dec 31 17:15:37 EST 2015 // begin #include "rusefi_types.h" typedef struct { @@ -1289,6 +1289,7 @@ typedef struct { */ float suckedOffCoef; /** + * TODO make suckedOffCoef an array by RPM * offset 1836 */ float unused71[7]; @@ -1297,6 +1298,7 @@ typedef struct { */ float addedToWallCoef; /** + * TODO make addedToWallCoef an array by RPM * offset 1868 */ float unused72[7]; @@ -1414,11 +1416,11 @@ typedef struct { /** * offset 2200 */ - float decelEnleanmentThreshold; + float engineLoadDecelEnleanmentThreshold; /** * offset 2204 */ - float decelEnleanmentMultiplier; + float engineLoadDecelEnleanmentMultiplier; /** * offset 2208 */ @@ -1446,7 +1448,15 @@ typedef struct { /** * offset 2232 */ - int unused[196]; + float tpsDecelEnleanmentThreshold; + /** + * offset 2236 + */ + float tpsDecelEnleanmentMultiplier; + /** + * offset 2240 + */ + int unused[194]; /** total size 3016*/ } engine_configuration_s; @@ -1595,4 +1605,4 @@ typedef struct { } persistent_config_s; // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Dec 31 12:46:57 EST 2015 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Dec 31 17:15:37 EST 2015 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 72fe1b374d..64d08ca1d5 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -717,16 +717,18 @@ #define tpsAccelEnrichmentMultiplier_offset_hex 890 #define engineLoadAccelLength_offset 2196 #define engineLoadAccelLength_offset_hex 894 -#define decelEnleanmentThreshold_offset 2200 -#define decelEnleanmentThreshold_offset_hex 898 -#define decelEnleanmentMultiplier_offset 2204 +#define engineLoadDecelEnleanmentThreshold_offset 2200 +#define engineLoadDecelEnleanmentThreshold_offset_hex 898 +#define engineLoadDecelEnleanmentMultiplier_offset 2204 #define engineLoadAccelEnrichmentThreshold_offset 2208 #define engineLoadAccelEnrichmentMultiplier_offset 2212 #define fatalErrorPin_offset 2216 #define warninigPin_offset 2220 #define configResetPin_offset 2224 #define uartConsoleSerialSpeed_offset 2228 -#define unused_offset 2232 +#define tpsDecelEnleanmentThreshold_offset 2232 +#define tpsDecelEnleanmentMultiplier_offset 2236 +#define unused_offset 2240 #define le_formulas1_offset 3016 #define le_formulas2_offset 3216 #define le_formulas3_offset 3416 diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 540da9a7e9..674bfdfb4a 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -582,9 +582,9 @@ baro_corr_table_t baroCorrTable; int tachPulseTriggerIndex;trigger cycle index at which we start tach pulse (performance consideration);"index", 1, 0, 0.0, 360.0, 0 float suckedOffCoef;;"%", 1, 0, 0.0, 300.0, 2 - float[7] unused71; + float[7] unused71;TODO make suckedOffCoef an array by RPM; float addedToWallCoef;;"%", 1, 0, 0.0, 300.0, 2 - float[7] unused72; + float[7] unused72;TODO make addedToWallCoef an array by RPM; float mapErrorLowValue;kPa value which is too low to be true;"kPa", 1, 0, -100.0, 100.0, 2 float mapErrorHighValue;kPa value which is too high to be true;"kPa", 1, 0, -100.0, 800.0, 2 int step1RpmWindow;RPMs prior to step1rpm point where ignition advance is retarded;"rpm", 1, 0, 0, 3000.0, 2 @@ -616,8 +616,8 @@ baro_corr_table_t baroCorrTable; int engineLoadAccelLength;;"len", 1, 0, 1, 200, 3 - float decelEnleanmentThreshold;;"roc", 1, 0, 0, 200, 3 - float decelEnleanmentMultiplier;;"coeff", 1, 0, 0, 200, 3 + float engineLoadDecelEnleanmentThreshold;;"roc", 1, 0, 0, 200, 3 + float engineLoadDecelEnleanmentMultiplier;;"coeff", 1, 0, 0, 200, 3 float engineLoadAccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3 float engineLoadAccelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3 @@ -626,7 +626,9 @@ baro_corr_table_t baroCorrTable; brain_pin_e warninigPin; brain_pin_e configResetPin; uint32_t uartConsoleSerialSpeed;;"BPs", 1, 0, 0,1000000, 0 - int[196] unused; + float tpsDecelEnleanmentThreshold;;"roc", 1, 0, 0, 200, 3 + float tpsDecelEnleanmentMultiplier;;"coeff", 1, 0, 0, 200, 3 + int[194] unused; end_struct diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 32ed072f36..bf2398418f 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 Thu Dec 31 12:46:57 EST 2015 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Dec 31 16:50:15 EST 2015 public class Fields { public static final Field ENGINETYPE = new Field("ENGINETYPE", 0, FieldType.INT); public static final Field UNUSEDOFFSET4 = new Field("UNUSEDOFFSET4", 4, FieldType.INT); @@ -450,14 +450,16 @@ public class Fields { public static final Field TPSACCELENRICHMENTTHRESHOLD = new Field("TPSACCELENRICHMENTTHRESHOLD", 2188, FieldType.FLOAT); public static final Field TPSACCELENRICHMENTMULTIPLIER = new Field("TPSACCELENRICHMENTMULTIPLIER", 2192, FieldType.FLOAT); public static final Field ENGINELOADACCELLENGTH = new Field("ENGINELOADACCELLENGTH", 2196, FieldType.INT); - public static final Field DECELENLEANMENTTHRESHOLD = new Field("DECELENLEANMENTTHRESHOLD", 2200, FieldType.FLOAT); - public static final Field DECELENLEANMENTMULTIPLIER = new Field("DECELENLEANMENTMULTIPLIER", 2204, FieldType.FLOAT); + public static final Field ENGINELOADDECELENLEANMENTTHRESHOLD = new Field("ENGINELOADDECELENLEANMENTTHRESHOLD", 2200, FieldType.FLOAT); + public static final Field ENGINELOADDECELENLEANMENTMULTIPLIER = new Field("ENGINELOADDECELENLEANMENTMULTIPLIER", 2204, FieldType.FLOAT); public static final Field ENGINELOADACCELENRICHMENTTHRESHOLD = new Field("ENGINELOADACCELENRICHMENTTHRESHOLD", 2208, FieldType.FLOAT); public static final Field ENGINELOADACCELENRICHMENTMULTIPLIER = new Field("ENGINELOADACCELENRICHMENTMULTIPLIER", 2212, FieldType.FLOAT); public static final Field FATALERRORPIN = new Field("FATALERRORPIN", 2216, FieldType.INT, brain_pin_e); public static final Field WARNINIGPIN = new Field("WARNINIGPIN", 2220, FieldType.INT, brain_pin_e); public static final Field CONFIGRESETPIN = new Field("CONFIGRESETPIN", 2224, FieldType.INT, brain_pin_e); public static final Field UARTCONSOLESERIALSPEED = new Field("UARTCONSOLESERIALSPEED", 2228, FieldType.INT); + public static final Field TPSDECELENRICHMENTTHRESHOLD = new Field("TPSDECELENRICHMENTTHRESHOLD", 2232, FieldType.FLOAT); + public static final Field TPSDECELENRICHMENTMULTIPLIER = new Field("TPSDECELENRICHMENTMULTIPLIER", 2236, FieldType.FLOAT); public static final Field LE_FORMULAS1 = new Field("LE_FORMULAS1", 3016, FieldType.INT); public static final Field LE_FORMULAS2 = new Field("LE_FORMULAS2", 3216, FieldType.INT); public static final Field LE_FORMULAS3 = new Field("LE_FORMULAS3", 3416, FieldType.INT);