From 570ce6287187deace69869e6988d0a1822734765 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 15 Apr 2019 20:42:22 -0400 Subject: [PATCH] Revert "The Big Refactoring of 2019: configuration version should not be a global variable fix #656" This reverts commit 98a75d19 --- firmware/controllers/algo/engine.h | 6 ------ firmware/controllers/algo/engine_configuration.cpp | 9 ++++++++- firmware/controllers/algo/engine_configuration.h | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 6663a54b5a..9038d00b8d 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -422,12 +422,6 @@ public: */ efitick_t stopEngineRequestTimeNt = 0; - /** - * This counter is incremented every time user adjusts ECU parameters online (either via dev console or other - * tuning software) - */ - volatile int globalConfigurationVersion = 0; - /** * always 360 or 720, never zero */ diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 8fb4e8a046..205dd7b89c 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -138,6 +138,12 @@ static fuel_table_t alphaNfuel = { {/*15 engineLoad=100.00*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx} }; +/** + * This counter is incremented every time user adjusts ECU parameters online (either via dev console or other + * tuning software) + */ +volatile int globalConfigurationVersion = 0; + /** * Current engine configuration. On firmware start we assign empty configuration, then * we copy actual configuration after reading settings. @@ -159,6 +165,7 @@ void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */ } + extern LoggingWithStorage sharedLogger; /** @@ -166,7 +173,7 @@ extern LoggingWithStorage sharedLogger; * online tuning of most values in the maps does not count as configuration change, but 'Burn' command does */ void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - ENGINE(globalConfigurationVersion++); + globalConfigurationVersion++; #if EFI_DEFAILED_LOGGING scheduleMsg(&sharedLogger, "set globalConfigurationVersion=%d", globalConfigurationVersion); #endif /* EFI_DEFAILED_LOGGING */ diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index e2b057e463..e589e937b3 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -73,6 +73,7 @@ void setDefaultSdCardParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE); void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE); void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE); +int getGlobalConfigurationVersion(void); void commonFrankensoAnalogInputs(engine_configuration_s *engineConfiguration); void setFrankenso0_1_joystick(engine_configuration_s *engineConfiguration);