diff --git a/firmware/console/binary/tunerstudio_outputs.h b/firmware/console/binary/tunerstudio_outputs.h index afe51ad630..0a43041de7 100644 --- a/firmware/console/binary/tunerstudio_outputs.h +++ b/firmware/console/binary/tunerstudio_outputs.h @@ -162,6 +162,9 @@ typedef struct { uint32_t timeSeconds; // 112 uint32_t engineMode; // 116 uint32_t firmwareVersion; // 120 + // todo: this not needed in light of TS_SIGNATURE but rusEFI console still uses it. Need to migrate + // rusEFI console from TS_FILE_VERSION to TS_SIGNATURE :( + uint32_t tsConfigVersion; // 124 // These two fields indicate to TS that we'd like to set a particular field to a particular value @@ -216,7 +219,7 @@ typedef struct { scaled_voltage rawIat; // 236 scaled_voltage rawOilPressure; // 238 - int16_t tuneCrc16; + int16_t tuneCrc16; // 240 uint8_t unusedAtTheEnd[2]; // we have some unused bytes to allow compatible TS changes // Temporary - will remove soon diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 4bed869a76..675df2a3ff 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -253,6 +253,11 @@ void Engine::preCalculate(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // we take 2 bytes of crc32, no idea if it's right to call it crc16 or not // we have a hack here - we rely on the fact that engineMake is the first of three relevant fields tsOutputChannels.engineMakeCodeNameCrc16 = crc32(engineConfiguration->engineMake, 3 * VEHICLE_INFO_SIZE); + + // 'warning_message' has very annoying complications but unfortunately I find 'warning_message' to be useful enough :( + // a proper solution could be to move 'warning_message' to a separate TS page + tsOutputChannels.tuneCrc16 = crc32(engineConfiguration, sizeof(engine_configuration_s)) + + crc32(engine->config->afterstartCoolantBins, sizeof(persistent_config_s) - afterstartCoolantBins_offset); #endif /* EFI_TUNER_STUDIO */ } diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 78364ee2c2..52f30c675d 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -171,6 +171,7 @@ extern LoggingWithStorage sharedLogger; * online tuning of most values in the maps does not count as configuration change, but 'Burn' command does * * this method is NOT currently invoked on ECU start - actual user input has to happen! + * See preCalculate which is invoked BOTH on start and configuration change */ void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) { ENGINE(globalConfigurationVersion++); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index a765f99413..31e42255dc 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -717,6 +717,6 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20200602; + return 20200604; } #endif /* EFI_UNIT_TEST */ diff --git a/java_console/models/src/com/rusefi/core/Sensor.java b/java_console/models/src/com/rusefi/core/Sensor.java index 1cbd378746..50d530b636 100644 --- a/java_console/models/src/com/rusefi/core/Sensor.java +++ b/java_console/models/src/com/rusefi/core/Sensor.java @@ -91,9 +91,8 @@ public enum Sensor { FIRMWARE_VERSION("FW version", SensorCategory.OPERATIONS, FieldType.INT, 120), TS_CONFIG_VERSION(".ini version", SensorCategory.OPERATIONS, FieldType.INT, 124), + engineMakeCodeNameCrc16("engine crc16", SensorCategory.STATUS, FieldType.INT16, 134, 0, 5), // Errors - totalTriggerErrorCounter("trigger total error counter", SensorCategory.STATUS, FieldType.INT, 128, 0, 5), - orderingErrorCounter("trigger order error counter", SensorCategory.STATUS, FieldType.INT, 132, 0, 5), errorCodeCounter("error counter", SensorCategory.STATUS, FieldType.INT, 136, 0, 5), lastErrorCode("last error", SensorCategory.STATUS, FieldType.INT, 138, 0, 5), @@ -111,6 +110,8 @@ public enum Sensor { debugIntField4("debug i4", SensorCategory.DEBUG, FieldType.INT16, 196, 0, 5), debugIntField5("debug i5", SensorCategory.DEBUG, FieldType.INT16, 198, 0, 5), + tuneCrc16("tune crc16", SensorCategory.STATUS, FieldType.INT16, 240, 0, 5), + // Synthetic (console only) channels ETB_CONTROL_QUALITY("ETB metric", SensorCategory.SNIFFING, "", 100), ; diff --git a/java_console/models/src/com/rusefi/rusEFIVersion.java b/java_console/models/src/com/rusefi/rusEFIVersion.java index 2c2df5a9c2..b16df8dc6d 100644 --- a/java_console/models/src/com/rusefi/rusEFIVersion.java +++ b/java_console/models/src/com/rusefi/rusEFIVersion.java @@ -3,6 +3,6 @@ package com.rusefi; import java.util.concurrent.atomic.AtomicReference; public class rusEFIVersion { - public static final int CONSOLE_VERSION = 20200601; + public static final int CONSOLE_VERSION = 20200604; public static AtomicReference firmwareVersion = new AtomicReference<>("N/A"); } diff --git a/java_console/ui/src/com/rusefi/SensorLogger.java b/java_console/ui/src/com/rusefi/SensorLogger.java index 7d19d67e8b..6604989d1d 100644 --- a/java_console/ui/src/com/rusefi/SensorLogger.java +++ b/java_console/ui/src/com/rusefi/SensorLogger.java @@ -84,6 +84,8 @@ public class SensorLogger { Sensor.errorCodeCounter, Sensor.lastErrorCode, + Sensor.engineMakeCodeNameCrc16, + Sensor.tuneCrc16, }; private static long fileStartTime;