EFI_CJ125_DIRECTLY_CONNECTED_UR should be a runtime parameter fix #914

This commit is contained in:
rusefi 2019-09-03 18:44:05 -04:00
parent 9049077678
commit 9f50f9a4f7
12 changed files with 27 additions and 30 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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,