From f3279c108eca148f35cb5fc2de3a52e1bd79dc5b Mon Sep 17 00:00:00 2001 From: rusefi Date: Wed, 19 Apr 2023 22:09:48 -0400 Subject: [PATCH] proteus F7 QC build is broken #5242 --- .../compile_proteus_f7_hardware_QC_special_build.sh | 4 +--- firmware/controllers/algo/engine_configuration.cpp | 6 +++--- firmware/controllers/algo/engine_configuration.h | 2 +- firmware/controllers/engine_controller.cpp | 10 +++++----- firmware/controllers/lua/lua_hooks.cpp | 2 +- firmware/controllers/settings.cpp | 2 +- firmware/controllers/trigger/trigger_emulator_algo.cpp | 6 +++--- 7 files changed, 15 insertions(+), 17 deletions(-) diff --git a/firmware/config/boards/proteus/compile_proteus_f7_hardware_QC_special_build.sh b/firmware/config/boards/proteus/compile_proteus_f7_hardware_QC_special_build.sh index 1c8417b90b..ada3743ee2 100755 --- a/firmware/config/boards/proteus/compile_proteus_f7_hardware_QC_special_build.sh +++ b/firmware/config/boards/proteus/compile_proteus_f7_hardware_QC_special_build.sh @@ -1,8 +1,6 @@ #!/bin/bash -# export EXTRA_PARAMS="-DVR_HW_CHECK_MODE=TRUE -DHW_CHECK_MODE=TRUE -DHW_CHECK_SD=TRUE -DHW_CHECK_ALWAYS_STIMULATE=TRUE" - -export EXTRA_PARAMS="-DHW_CHECK_SD=TRUE" +export EXTRA_PARAMS="-DVR_HW_CHECK_MODE=TRUE -DHW_CHECK_MODE=TRUE -DHW_CHECK_SD=TRUE -DHW_CHECK_ALWAYS_STIMULATE=TRUE" export VAR_DEF_ENGINE_TYPE=-DDEFAULT_ENGINE_TYPE=PROTEUS_QC_TEST_BOARD diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index ee577065eb..bd2f0c4764 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -152,7 +152,7 @@ static void wipeStrings() { void onBurnRequest() { wipeStrings(); - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("burn"); } // Weak link a stub so that every board doesn't have to implement this function @@ -165,9 +165,9 @@ __attribute__((weak)) void boardOnConfigurationChange(engine_configuration_s* /* * 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() { +void incrementGlobalConfigurationVersion(const char * msg) { if (!hasRememberedConfiguration) { - firmwareError(OBD_PCM_Processor_Fault, "too early to invoke incrementGlobalConfigurationVersion"); + firmwareError(OBD_PCM_Processor_Fault, "too early to invoke incrementGlobalConfigurationVersion %s", msg); } engine->globalConfigurationVersion++; #if EFI_DEFAILED_LOGGING diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index 5d9339f5af..5444ed1097 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -40,7 +40,7 @@ void setDefaultBasePins(); void setDefaultSdCardParameters(); void onBurnRequest(); -void incrementGlobalConfigurationVersion(); +void incrementGlobalConfigurationVersion(const char * msg = "undef"); void commonFrankensoAnalogInputs(); void setFrankenso0_1_joystick(); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 1bc708603e..27bb274499 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -305,7 +305,7 @@ static void setBit(const char *offsetStr, const char *bitStr, const char *valueS * this response is part of rusEfi console API */ efiPrintf("bit%s%d/%d is %d", CONSOLE_DATA_PROTOCOL_TAG, offset, bit, value); - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("setBit"); } static void setShort(const int offset, const int value) { @@ -314,7 +314,7 @@ static void setShort(const int offset, const int value) { uint16_t *ptr = (uint16_t *) (&((char *) engineConfiguration)[offset]); *ptr = (uint16_t) value; getShort(offset); - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("setShort"); } static void setByte(const int offset, const int value) { @@ -323,7 +323,7 @@ static void setByte(const int offset, const int value) { uint8_t *ptr = (uint8_t *) (&((char *) engineConfiguration)[offset]); *ptr = (uint8_t) value; getByte(offset); - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("setByte"); } static void getBit(int offset, int bit) { @@ -354,7 +354,7 @@ static void setInt(const int offset, const int value) { int *ptr = (int *) (&((char *) engineConfiguration)[offset]); *ptr = value; getInt(offset); - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("setInt"); } static void getFloat(int offset) { @@ -384,7 +384,7 @@ static void setFloat(const char *offsetStr, const char *valueStr) { float *ptr = (float *) (&((char *) engineConfiguration)[offset]); *ptr = value; getFloat(offset); - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("setFloat"); } static void initConfigActions() { diff --git a/firmware/controllers/lua/lua_hooks.cpp b/firmware/controllers/lua/lua_hooks.cpp index 09220116dd..6de5bb4723 100644 --- a/firmware/controllers/lua/lua_hooks.cpp +++ b/firmware/controllers/lua/lua_hooks.cpp @@ -838,7 +838,7 @@ void configureRusefiLuaHooks(lua_State* l) { auto incrementVersion = lua_toboolean(l, 3); setConfigValueByName(propertyName, value); if (incrementVersion) { - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("lua"); } return 0; }); diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index c217fd45e1..d33096e614 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -1149,7 +1149,7 @@ void setEngineType(int value) { writeToFlashNow(); #endif // EFI_INTERNAL_FLASH } - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("engineType"); #if ! EFI_UNIT_TEST doPrintConfiguration(); #endif // ! EFI_UNIT_TEST diff --git a/firmware/controllers/trigger/trigger_emulator_algo.cpp b/firmware/controllers/trigger/trigger_emulator_algo.cpp index fdc5984626..b00ba17cc9 100644 --- a/firmware/controllers/trigger/trigger_emulator_algo.cpp +++ b/firmware/controllers/trigger/trigger_emulator_algo.cpp @@ -177,7 +177,7 @@ void enableTriggerStimulator(bool incGlobalConfiguration) { engine->triggerCentral.directSelfStimulation = true; engine->rpmCalculator.Register(); if (incGlobalConfiguration) { - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("trgSim"); } } @@ -186,14 +186,14 @@ void enableTriggerStimulator(bool incGlobalConfiguration) { void enableExternalTriggerStimulator() { startSimulatedTriggerSignal(); engine->triggerCentral.directSelfStimulation = false; - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("extTrg"); } void disableTriggerStimulator() { engine->triggerCentral.directSelfStimulation = false; triggerEmulatorSignal.stop(); hasInitTriggerEmulator = false; - incrementGlobalConfigurationVersion(); + incrementGlobalConfigurationVersion("disTrg"); } void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousConfiguration) {