diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index f8ea4fcddc..25483941dc 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -412,6 +412,8 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->iat.config.bias_resistor = 2700; + engineConfiguration->warningPeriod = 10; + engineConfiguration->step1rpm = 3000; engineConfiguration->step1timing = 10; engineConfiguration->step1RpmWindow = 500; diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 45c411287f..7956d5065b 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 Jul 21 23:14:17 EDT 2016 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jul 22 17:07:24 EDT 2016 // begin #ifndef ENGINE_CONFIGURATION_GENERATED_H_ #define ENGINE_CONFIGURATION_GENERATED_H_ @@ -1302,7 +1302,7 @@ typedef struct { /** * offset 1526 */ - int16_t unusedShort; + int16_t warningPeriod; /** * offset 1528 */ @@ -1905,4 +1905,4 @@ typedef struct { #endif // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Jul 21 23:14:17 EDT 2016 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jul 22 17:07:24 EDT 2016 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index f2de1538b6..29cd67a097 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -660,7 +660,7 @@ #define acCutoffLowRpm_offset 1520 #define acCutoffHighRpm_offset 1522 #define acIdleRpmBump_offset 1524 -#define unusedShort_offset 1526 +#define warningPeriod_offset 1526 #define vRefAdcChannel_offset 1528 #define knockDetectionWindowStart_offset 1532 #define knockDetectionWindowEnd_offset 1536 diff --git a/firmware/controllers/error_handling.cpp b/firmware/controllers/error_handling.cpp index 91540f8405..760c58de5a 100644 --- a/firmware/controllers/error_handling.cpp +++ b/firmware/controllers/error_handling.cpp @@ -55,7 +55,7 @@ static bool isWarningStreamInitialized = false; static MemoryStream warningStream; bool isWarningNow(efitimesec_t now) { - return absI(now - engine->engineState.timeOfPreviousWarning) < 10; + return absI(now - engine->engineState.timeOfPreviousWarning) < engineConfiguration->warningPeriod; } /** diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 88a01418f4..de25eaa4c5 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -947,8 +947,8 @@ static void setInjectorLag(float value) { } static void getValue(const char *paramStr) { - if (strEqualCaseInsensitive(paramStr, "todo")) { - scheduleMsg(&logger, "something"); + if (strEqualCaseInsensitive(paramStr, "warningPeriod")) { + scheduleMsg(&logger, "warningPeriod=%d", engineConfiguration->warningPeriod); } #if EFI_RTC || defined(__DOXYGEN__) @@ -975,6 +975,8 @@ static void setValue(const char *paramStr, const char *valueStr) { } else if (strEqualCaseInsensitive(paramStr, "alt_p")) { setAltPFactor(valueF); #endif + } else if (strEqualCaseInsensitive(paramStr, "warningPeriod")) { + engineConfiguration->warningPeriod = valueI; } else if (strEqualCaseInsensitive(paramStr, "step1rpm")) { engineConfiguration->step1rpm = valueI; } else if (strEqualCaseInsensitive(paramStr, "step1timing")) { diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 55b23ca5ee..dbd1b651ab 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -611,7 +611,7 @@ custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "false", "true" int16_t acCutoffHighRpm; int16_t acIdleRpmBump; - int16_t unusedShort; + int16_t warningPeriod; adc_channel_e vRefAdcChannel; diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index e136f17bd3..2295cb6937 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 Thu Jul 21 23:14:17 EDT 2016 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jul 22 17:07:24 EDT 2016 pageSize = 16376 page = 1 @@ -466,7 +466,7 @@ page = 1 ;skipping acCutoffLowRpm offset 1520 ;skipping acCutoffHighRpm offset 1522 ;skipping acIdleRpmBump offset 1524 -;skipping unusedShort offset 1526 +;skipping warningPeriod offset 1526 vRefAdcChannel = bits, U32, 1528, [0:4] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "Disabled", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" ;skipping knockDetectionWindowStart offset 1532 ;skipping knockDetectionWindowEnd offset 1536 diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index d0c82093b7..44779e0391 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 Jul 21 23:14:17 EDT 2016 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jul 22 17:07:24 EDT 2016 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int FSIO_ADC_COUNT = 4; @@ -664,7 +664,7 @@ public class Fields { public static final int acCutoffLowRpm_offset = 1520; public static final int acCutoffHighRpm_offset = 1522; public static final int acIdleRpmBump_offset = 1524; - public static final int unusedShort_offset = 1526; + public static final int warningPeriod_offset = 1526; public static final int vRefAdcChannel_offset = 1528; public static final int knockDetectionWindowStart_offset = 1532; public static final int knockDetectionWindowEnd_offset = 1536; @@ -1380,7 +1380,7 @@ public class Fields { public static final Field ACCUTOFFLOWRPM = Field.create("ACCUTOFFLOWRPM", 1520, FieldType.INT); public static final Field ACCUTOFFHIGHRPM = Field.create("ACCUTOFFHIGHRPM", 1522, FieldType.INT); public static final Field ACIDLERPMBUMP = Field.create("ACIDLERPMBUMP", 1524, FieldType.INT); - public static final Field UNUSEDSHORT = Field.create("UNUSEDSHORT", 1526, FieldType.INT); + public static final Field WARNINGPERIOD = Field.create("WARNINGPERIOD", 1526, FieldType.INT); public static final Field VREFADCCHANNEL = Field.create("VREFADCCHANNEL", 1528, FieldType.INT, adc_channel_e); public static final Field KNOCKDETECTIONWINDOWSTART = Field.create("KNOCKDETECTIONWINDOWSTART", 1532, FieldType.FLOAT); public static final Field KNOCKDETECTIONWINDOWEND = Field.create("KNOCKDETECTIONWINDOWEND", 1536, FieldType.FLOAT);