From 16ada2d85d5c3e022a96add536283bf6d3e8623e Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 3 Apr 2020 16:06:21 -0400 Subject: [PATCH] extracting magic constant --- .../kinetis/config/controllers/algo/rusefi_generated.h | 1 + firmware/controllers/can/can_verbose.cpp | 8 ++++---- firmware/controllers/generated/rusefi_generated.h | 1 + firmware/integration/rusefi_config.txt | 1 + .../models/src/com/rusefi/config/generated/Fields.java | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h b/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h index 69452b6cda..17812c1b6b 100644 --- a/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h +++ b/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h @@ -1646,6 +1646,7 @@ #define overrideCrankingIacSetting_offset_hex 5c4 #define overrideCrankingIgnition_offset 516 #define overrideCrankingIgnition_offset_hex 204 +#define PACK_ADD_TEMPERATURE 40 #define PACK_MULT_AFR 1000 #define PACK_MULT_ANGLE 50 #define PACK_MULT_MS 300 diff --git a/firmware/controllers/can/can_verbose.cpp b/firmware/controllers/can/can_verbose.cpp index f51c71d16f..627671e5a6 100644 --- a/firmware/controllers/can/can_verbose.cpp +++ b/firmware/controllers/can/can_verbose.cpp @@ -99,12 +99,12 @@ struct Sensors1 { static void populateFrame(Sensors1& msg) { msg.map = getMap(); - msg.clt = getCoolantTemperature() + 40; - msg.iat = getIntakeAirTemperature() + 40; + msg.clt = getCoolantTemperature() + PACK_ADD_TEMPERATURE; + msg.iat = getIntakeAirTemperature() + PACK_ADD_TEMPERATURE; // todo: does aux temp even work? - msg.aux1 = 0 + 40; - msg.aux2 = 0 + 40; + msg.aux1 = 0 + PACK_ADD_TEMPERATURE; + msg.aux2 = 0 + PACK_ADD_TEMPERATURE; msg.mcuTemp = getMCUInternalTemperature(); msg.fuelLevel = engine->sensors.fuelTankLevel; diff --git a/firmware/controllers/generated/rusefi_generated.h b/firmware/controllers/generated/rusefi_generated.h index 8bf911ed32..7acb49bb87 100644 --- a/firmware/controllers/generated/rusefi_generated.h +++ b/firmware/controllers/generated/rusefi_generated.h @@ -1646,6 +1646,7 @@ #define overrideCrankingIacSetting_offset_hex 5c4 #define overrideCrankingIgnition_offset 516 #define overrideCrankingIgnition_offset_hex 204 +#define PACK_ADD_TEMPERATURE 40 #define PACK_MULT_AFR 1000 #define PACK_MULT_ANGLE 50 #define PACK_MULT_MS 300 diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 79b90cb3eb..98c68e0f05 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -139,6 +139,7 @@ struct_no_prefix engine_configuration_s #define PACK_MULT_PRESSURE 30 #define PACK_MULT_PERCENT 100 #define PACK_MULT_TEMPERATURE 100 +#define PACK_ADD_TEMPERATURE 40 #define PACK_MULT_MS 300 #define PACK_MULT_AFR 1000 #define PACK_MULT_ANGLE 50 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 02c55e2f51..29e4430379 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 Tue Mar 31 16:40:27 EDT 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Fri Apr 03 16:05:17 EDT 2020 // by class com.rusefi.output.FileJavaFieldsConsumer import com.rusefi.config.*; @@ -1084,6 +1084,7 @@ public class Fields { public static final int overrideCrankingIacSetting_offset = 1476; public static final int overrideCrankingIgnition_offset = 516; public static final int overrideCrankingIgnition_offset_hex = 204; + public static final int PACK_ADD_TEMPERATURE = 40; public static final int PACK_MULT_AFR = 1000; public static final int PACK_MULT_ANGLE = 50; public static final int PACK_MULT_MS = 300;