From 9f50f9a4f78725667f24b8990a250b48c3d2bf16 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 3 Sep 2019 18:44:05 -0400 Subject: [PATCH] EFI_CJ125_DIRECTLY_CONNECTED_UR should be a runtime parameter fix #914 --- firmware/config/boards/prometheus/efifeatures.h | 3 --- firmware/config/boards/subaru-ej20gn/efifeatures.h | 3 --- .../engine_configuration_generated_structures.h | 7 ++++--- firmware/controllers/generated/rusefi_generated.h | 4 ++-- firmware/hw_layer/sensors/cj125.cpp | 9 +++------ firmware/integration/rusefi_config.txt | 2 +- firmware/tunerstudio/rusefi.ini | 5 +++-- firmware/tunerstudio/rusefi.input | 1 + firmware/tunerstudio/rusefi_frankenso.ini | 5 +++-- firmware/tunerstudio/rusefi_microrusefi.ini | 5 +++-- firmware/tunerstudio/rusefi_prometheus.ini | 5 +++-- .../models/src/com/rusefi/config/generated/Fields.java | 8 ++++---- 12 files changed, 27 insertions(+), 30 deletions(-) diff --git a/firmware/config/boards/prometheus/efifeatures.h b/firmware/config/boards/prometheus/efifeatures.h index d0afdd6445..c46f40f717 100644 --- a/firmware/config/boards/prometheus/efifeatures.h +++ b/firmware/config/boards/prometheus/efifeatures.h @@ -112,9 +112,6 @@ #undef EFI_IDLE_INCREMENTAL_PID_CIC #define EFI_IDLE_INCREMENTAL_PID_CIC TRUE -#undef EFI_CJ125_DIRECTLY_CONNECTED_UR -#define EFI_CJ125_DIRECTLY_CONNECTED_UR TRUE - #define RPM_LOW_THRESHOLD 8 // RPM=8 is an empirical lower sensitivity threshold of MAX9926 for 60-2 #define NO_RPM_EVENTS_TIMEOUT_SECS 5 // (RPM < 12) diff --git a/firmware/config/boards/subaru-ej20gn/efifeatures.h b/firmware/config/boards/subaru-ej20gn/efifeatures.h index 5794dbaf64..3d6bd28099 100644 --- a/firmware/config/boards/subaru-ej20gn/efifeatures.h +++ b/firmware/config/boards/subaru-ej20gn/efifeatures.h @@ -110,9 +110,6 @@ #undef EFI_IDLE_INCREMENTAL_PID_CIC #define EFI_IDLE_INCREMENTAL_PID_CIC TRUE -#undef EFI_CJ125_DIRECTLY_CONNECTED_UR -#define EFI_CJ125_DIRECTLY_CONNECTED_UR TRUE - #define RPM_LOW_THRESHOLD 8 // RPM=8 is an empirical lower sensitivity threshold of MAX9926 for 60-2 #define NO_RPM_EVENTS_TIMEOUT_SECS 5 // (RPM < 12) diff --git a/firmware/controllers/generated/engine_configuration_generated_structures.h b/firmware/controllers/generated/engine_configuration_generated_structures.h index 2336c1fb3d..425c4fc45b 100644 --- a/firmware/controllers/generated/engine_configuration_generated_structures.h +++ b/firmware/controllers/generated/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Mon Sep 02 00:13:32 EDT 2019 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 03 18:36:09 EDT 2019 // by class com.rusefi.output.CHeaderConsumer // begin #ifndef CONTROLLERS_GENERATED_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H @@ -1084,8 +1084,9 @@ struct engine_configuration_s { offset 76 bit 14 */ bool showSdCardWarning : 1; /** + * looks like 3v range should be enough, divider not needed offset 76 bit 15 */ - bool issue_294_15 : 1; + bool cj125isUrDivided : 1; /** offset 76 bit 16 */ bool issue_294_16 : 1; @@ -2820,4 +2821,4 @@ typedef struct persistent_config_s persistent_config_s; #endif // end -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Mon Sep 02 00:13:32 EDT 2019 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 03 18:36:09 EDT 2019 diff --git a/firmware/controllers/generated/rusefi_generated.h b/firmware/controllers/generated/rusefi_generated.h index 2960d0ae8b..2965607a27 100644 --- a/firmware/controllers/generated/rusefi_generated.h +++ b/firmware/controllers/generated/rusefi_generated.h @@ -301,6 +301,8 @@ #define cj125isLsu49_offset_hex 4c #define cj125isUaDivided_offset 76 #define cj125isUaDivided_offset_hex 4c +#define cj125isUrDivided_offset 76 +#define cj125isUrDivided_offset_hex 4c #define cj125SpiDevice_offset 2224 #define cj125SpiDevice_offset_hex 8b0 #define cj125ua_offset 2609 @@ -1258,8 +1260,6 @@ #define isMapAveragingEnabled_offset_hex 5c4 #define isSdCardEnabled_offset 744 #define isSdCardEnabled_offset_hex 2e8 -#define issue_294_15_offset 76 -#define issue_294_15_offset_hex 4c #define issue_294_16_offset 76 #define issue_294_16_offset_hex 4c #define issue_294_17_offset 76 diff --git a/firmware/hw_layer/sensors/cj125.cpp b/firmware/hw_layer/sensors/cj125.cpp index 18b346a0ca..f997cc7089 100644 --- a/firmware/hw_layer/sensors/cj125.cpp +++ b/firmware/hw_layer/sensors/cj125.cpp @@ -13,9 +13,6 @@ #if EFI_CJ125 && HAL_USE_SPI -// looks like 3v range should be enough, divider not needed -#define EFI_CJ125_DIRECTLY_CONNECTED_UR TRUE - #include "adc_inputs.h" //#define CJ125_DEBUG @@ -112,13 +109,13 @@ static float getUr() { #if ! EFI_UNIT_TEST if (CONFIG(cj125ur) != EFI_ADC_NONE) { #if EFI_PROD_CODE -#ifdef EFI_CJ125_DIRECTLY_CONNECTED_UR + if (!engineConfiguration->cj125isUrDivided) { // in case of directly connected Ur signal from CJ125 to the ADC pin of MCU return getVoltage("cj125ur", CONFIG(cj125ur)); -#else + } else { // if a standard voltage division scheme with OpAmp is used return getVoltageDivided("cj125ur", CONFIG(cj125ur)); -#endif /* EFI_CJ125_DIRECTLY_CONNECTED_UR */ + } #endif /* EFI_PROD_CODE */ } return 0.0f; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 6e86f0de2d..601b0910ee 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -297,7 +297,7 @@ bit cj125isLsu49; bit etb1_use_two_wires; bit etb2_use_two_wires; bit showSdCardWarning; -bit issue_294_15; +bit cj125isUrDivided;looks like 3v range should be enough, divider not needed bit issue_294_16; bit issue_294_17; bit issue_294_18; diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index d8fd751c69..7be991b22a 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -82,7 +82,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Mon Sep 02 00:13:32 EDT 2019 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 03 18:36:09 EDT 2019 pageSize = 20000 page = 1 @@ -106,7 +106,7 @@ page = 1 etb1_use_two_wires = bits, U32, 76, [12:12], "false", "true" etb2_use_two_wires = bits, U32, 76, [13:13], "false", "true" showSdCardWarning = bits, U32, 76, [14:14], "false", "true" - issue_294_15 = bits, U32, 76, [15:15], "false", "true" + cj125isUrDivided = bits, U32, 76, [15:15], "false", "true" issue_294_16 = bits, U32, 76, [16:16], "false", "true" issue_294_17 = bits, U32, 76, [17:17], "false", "true" issue_294_18 = bits, U32, 76, [18:18], "false", "true" @@ -2999,6 +2999,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "UA input", cj125ua, {isCJ125Enabled == 1} field = "UR input", cj125ur, {isCJ125Enabled == 1} field = "Is UA input divided?" cj125isUaDivided, {isCJ125Enabled == 1} + field = "Is UR input divided?" cj125isUrDivided, {isCJ125Enabled == 1} dialog = spiFunction, "SPI settings" field = "!ECU reboot needed to apply these settings" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 5f6b3929e8..b39a5ccaf6 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -2019,6 +2019,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "UA input", cj125ua, {isCJ125Enabled == 1} field = "UR input", cj125ur, {isCJ125Enabled == 1} field = "Is UA input divided?" cj125isUaDivided, {isCJ125Enabled == 1} + field = "Is UR input divided?" cj125isUrDivided, {isCJ125Enabled == 1} dialog = spiFunction, "SPI settings" field = "!ECU reboot needed to apply these settings" diff --git a/firmware/tunerstudio/rusefi_frankenso.ini b/firmware/tunerstudio/rusefi_frankenso.ini index fe70dd45a5..e3f691f42d 100644 --- a/firmware/tunerstudio/rusefi_frankenso.ini +++ b/firmware/tunerstudio/rusefi_frankenso.ini @@ -82,7 +82,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Mon Sep 02 00:13:37 EDT 2019 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 03 18:36:14 EDT 2019 pageSize = 20000 page = 1 @@ -106,7 +106,7 @@ page = 1 etb1_use_two_wires = bits, U32, 76, [12:12], "false", "true" etb2_use_two_wires = bits, U32, 76, [13:13], "false", "true" showSdCardWarning = bits, U32, 76, [14:14], "false", "true" - issue_294_15 = bits, U32, 76, [15:15], "false", "true" + cj125isUrDivided = bits, U32, 76, [15:15], "false", "true" issue_294_16 = bits, U32, 76, [16:16], "false", "true" issue_294_17 = bits, U32, 76, [17:17], "false", "true" issue_294_18 = bits, U32, 76, [18:18], "false", "true" @@ -2999,6 +2999,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "UA input", cj125ua, {isCJ125Enabled == 1} field = "UR input", cj125ur, {isCJ125Enabled == 1} field = "Is UA input divided?" cj125isUaDivided, {isCJ125Enabled == 1} + field = "Is UR input divided?" cj125isUrDivided, {isCJ125Enabled == 1} dialog = spiFunction, "SPI settings" field = "!ECU reboot needed to apply these settings" diff --git a/firmware/tunerstudio/rusefi_microrusefi.ini b/firmware/tunerstudio/rusefi_microrusefi.ini index 702a9b610c..dadc4023ce 100644 --- a/firmware/tunerstudio/rusefi_microrusefi.ini +++ b/firmware/tunerstudio/rusefi_microrusefi.ini @@ -82,7 +82,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Mon Sep 02 00:13:35 EDT 2019 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 03 18:36:12 EDT 2019 pageSize = 20000 page = 1 @@ -106,7 +106,7 @@ page = 1 etb1_use_two_wires = bits, U32, 76, [12:12], "false", "true" etb2_use_two_wires = bits, U32, 76, [13:13], "false", "true" showSdCardWarning = bits, U32, 76, [14:14], "false", "true" - issue_294_15 = bits, U32, 76, [15:15], "false", "true" + cj125isUrDivided = bits, U32, 76, [15:15], "false", "true" issue_294_16 = bits, U32, 76, [16:16], "false", "true" issue_294_17 = bits, U32, 76, [17:17], "false", "true" issue_294_18 = bits, U32, 76, [18:18], "false", "true" @@ -2984,6 +2984,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "UA input", cj125ua, {isCJ125Enabled == 1} field = "UR input", cj125ur, {isCJ125Enabled == 1} field = "Is UA input divided?" cj125isUaDivided, {isCJ125Enabled == 1} + field = "Is UR input divided?" cj125isUrDivided, {isCJ125Enabled == 1} dialog = spiFunction, "SPI settings" field = "!ECU reboot needed to apply these settings" diff --git a/firmware/tunerstudio/rusefi_prometheus.ini b/firmware/tunerstudio/rusefi_prometheus.ini index eff68f92e0..1867f783df 100644 --- a/firmware/tunerstudio/rusefi_prometheus.ini +++ b/firmware/tunerstudio/rusefi_prometheus.ini @@ -82,7 +82,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Mon Sep 02 00:13:40 EDT 2019 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 03 18:36:17 EDT 2019 pageSize = 20000 page = 1 @@ -106,7 +106,7 @@ page = 1 etb1_use_two_wires = bits, U32, 76, [12:12], "false", "true" etb2_use_two_wires = bits, U32, 76, [13:13], "false", "true" showSdCardWarning = bits, U32, 76, [14:14], "false", "true" - issue_294_15 = bits, U32, 76, [15:15], "false", "true" + cj125isUrDivided = bits, U32, 76, [15:15], "false", "true" issue_294_16 = bits, U32, 76, [16:16], "false", "true" issue_294_17 = bits, U32, 76, [17:17], "false", "true" issue_294_18 = bits, U32, 76, [18:18], "false", "true" @@ -2995,6 +2995,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "UA input", cj125ua, {isCJ125Enabled == 1} field = "UR input", cj125ur, {isCJ125Enabled == 1} field = "Is UA input divided?" cj125isUaDivided, {isCJ125Enabled == 1} + field = "Is UR input divided?" cj125isUrDivided, {isCJ125Enabled == 1} dialog = spiFunction, "SPI settings" field = "!ECU reboot needed to apply these settings" diff --git a/java_console/models/src/com/rusefi/config/generated/Fields.java b/java_console/models/src/com/rusefi/config/generated/Fields.java index 4e32669b8a..77060a7476 100644 --- a/java_console/models/src/com/rusefi/config/generated/Fields.java +++ b/java_console/models/src/com/rusefi/config/generated/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config.generated; -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Mon Sep 02 00:13:32 EDT 2019 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 03 18:36:09 EDT 2019 // by class com.rusefi.output.JavaFieldsConsumer import com.rusefi.config.*; @@ -186,6 +186,7 @@ public class Fields { public static final int cj125CsPinMode_offset = 2225; public static final int cj125isLsu49_offset = 76; public static final int cj125isUaDivided_offset = 76; + public static final int cj125isUrDivided_offset = 76; public static final int cj125SpiDevice_offset = 2224; public static final int cj125ua_offset = 2609; public static final int cj125ur_offset = 2610; @@ -835,7 +836,6 @@ public class Fields { public static final int isManualSpinningMode_offset = 1476; public static final int isMapAveragingEnabled_offset = 1476; public static final int isSdCardEnabled_offset = 744; - public static final int issue_294_15_offset = 76; public static final int issue_294_16_offset = 76; public static final int issue_294_17_offset = 76; public static final int issue_294_18_offset = 76; @@ -1299,7 +1299,7 @@ public class Fields { public static final Field ETB1_USE_TWO_WIRES = Field.create("ETB1_USE_TWO_WIRES", 76, FieldType.BIT, 12); public static final Field ETB2_USE_TWO_WIRES = Field.create("ETB2_USE_TWO_WIRES", 76, FieldType.BIT, 13); public static final Field SHOWSDCARDWARNING = Field.create("SHOWSDCARDWARNING", 76, FieldType.BIT, 14); - public static final Field ISSUE_294_15 = Field.create("ISSUE_294_15", 76, FieldType.BIT, 15); + public static final Field CJ125ISURDIVIDED = Field.create("CJ125ISURDIVIDED", 76, FieldType.BIT, 15); public static final Field ISSUE_294_16 = Field.create("ISSUE_294_16", 76, FieldType.BIT, 16); public static final Field ISSUE_294_17 = Field.create("ISSUE_294_17", 76, FieldType.BIT, 17); public static final Field ISSUE_294_18 = Field.create("ISSUE_294_18", 76, FieldType.BIT, 18); @@ -2083,7 +2083,7 @@ public class Fields { ETB1_USE_TWO_WIRES, ETB2_USE_TWO_WIRES, SHOWSDCARDWARNING, - ISSUE_294_15, + CJ125ISURDIVIDED, ISSUE_294_16, ISSUE_294_17, ISSUE_294_18,