From bc0444acdbb311df52b624635965b423880acc98 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 22 Feb 2023 15:39:27 -0800 Subject: [PATCH] switch to use gitversion.h --- firmware/console/binary/tunerstudio.cpp | 6 +++--- firmware/console/eficonsole.cpp | 5 +++-- firmware/console/status_loop.cpp | 4 ++-- firmware/controllers/algo/engine2.cpp | 9 +-------- firmware/controllers/engine_controller.cpp | 2 +- firmware/hw_layer/hardware.cpp | 2 +- misc/jenkins/build_working_folder.sh | 3 --- simulator/simulator/svnversion.h | 6 ------ unit_tests/global.h | 1 - 9 files changed, 11 insertions(+), 27 deletions(-) delete mode 100644 simulator/simulator/svnversion.h diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 2ae8daa8ea..70dcc7cc9c 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -80,7 +80,7 @@ #include #include "bench_test.h" -#include "svnversion.h" +#include "gitversion.h" #include "status_loop.h" #include "mmc_card.h" @@ -387,7 +387,7 @@ static void handleTestCommand(TsChannelBase* tsChannel) { * extension of the protocol to simplify troubleshooting */ tunerStudioDebug(tsChannel, "got T (Test)"); - tsChannel->write((const uint8_t*)VCS_VERSION, sizeof(VCS_VERSION)); + tsChannel->write((const uint8_t*)GIT_HASH_SHORT, sizeof(GIT_HASH_SHORT)); chsnprintf(testOutputBuffer, sizeof(testOutputBuffer), " %d %d", engine->engineState.warnings.lastErrorCode, tsState.testCommandCounter); tsChannel->write((const uint8_t*)testOutputBuffer, strlen(testOutputBuffer)); @@ -627,7 +627,7 @@ extern CommandHandler console_line_callback; static void handleGetVersion(TsChannelBase* tsChannel) { char versionBuffer[32]; - chsnprintf(versionBuffer, sizeof(versionBuffer), "rusEFI v%d@%s", getRusEfiVersion(), VCS_VERSION); + chsnprintf(versionBuffer, sizeof(versionBuffer), "rusEFI v%d@%s", getRusEfiVersion(), GIT_HASH_SHORT); tsChannel->sendResponse(TS_CRC, (const uint8_t *) versionBuffer, strlen(versionBuffer) + 1); } diff --git a/firmware/console/eficonsole.cpp b/firmware/console/eficonsole.cpp index b6129a1171..c5c2786195 100644 --- a/firmware/console/eficonsole.cpp +++ b/firmware/console/eficonsole.cpp @@ -26,7 +26,7 @@ #include "eficonsole.h" #include "console_io.h" -#include "svnversion.h" +#include "gitversion.h" static void testCritical() { chDbgCheck(0); @@ -38,7 +38,8 @@ static void myerror() { static void sayHello() { efiPrintf(PROTOCOL_HELLO_PREFIX " rusEFI LLC (c) 2012-2023. All rights reserved."); - efiPrintf(PROTOCOL_HELLO_PREFIX " rusEFI v%d@%s", getRusEfiVersion(), VCS_VERSION); + efiPrintf(PROTOCOL_HELLO_PREFIX " built from " GIT_HASH); + efiPrintf(PROTOCOL_HELLO_PREFIX " rusEFI v%d", getRusEfiVersion()); efiPrintf(PROTOCOL_HELLO_PREFIX " Chibios Kernel: %s", CH_KERNEL_VERSION); efiPrintf(PROTOCOL_HELLO_PREFIX " Compiled: " __DATE__ " - " __TIME__ ""); efiPrintf(PROTOCOL_HELLO_PREFIX " COMPILER=%s", __VERSION__); diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 81a63c747f..cf5f61637c 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -44,7 +44,7 @@ #include "main_trigger_callback.h" #include "spark_logic.h" #include "idle_thread.h" -#include "svnversion.h" +#include "gitversion.h" #include "can_hw.h" #include "periodic_thread_controller.h" #include "binary_logging.h" @@ -128,7 +128,7 @@ static Timer printVersionTimer; static void printRusefiVersion(const char *engineTypeName, const char *firmwareBuildId) { // VersionChecker in rusEFI console is parsing these version string, please follow the expected format efiPrintfProto(PROTOCOL_VERSION_TAG, "%d@%s %s %s %d", - getRusEfiVersion(), VCS_VERSION, + getRusEfiVersion(), GIT_HASH_SHORT, firmwareBuildId, engineTypeName, getTimeNowS()); diff --git a/firmware/controllers/algo/engine2.cpp b/firmware/controllers/algo/engine2.cpp index 7d3b02ba9c..374fa31e5d 100644 --- a/firmware/controllers/algo/engine2.cpp +++ b/firmware/controllers/algo/engine2.cpp @@ -17,10 +17,7 @@ #include "launch_control.h" #include "injector_model.h" #include "tunerstudio.h" - -#if EFI_PROD_CODE -#include "svnversion.h" -#endif +#include "gitversion.h" #if ! EFI_UNIT_TEST #include "status_loop.h" @@ -211,10 +208,6 @@ void EngineState::updateTChargeK(int rpm, float tps) { #endif } -#if EFI_SIMULATOR -#define VCS_VERSION "123" -#endif - void TriggerConfiguration::update() { VerboseTriggerSynchDetails = isVerboseTriggerSynchDetails(); TriggerType = getType(); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index ba7ab4a6ad..64a9ab2b95 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -659,7 +659,7 @@ static char UNUSED_RAM_SIZE[RAM_UNUSED_SIZE]; static char UNUSED_CCM_SIZE[CCM_UNUSED_SIZE] CCM_OPTIONAL; /** - * See also VCS_VERSION + * See also GIT_HASH */ int getRusEfiVersion(void) { if (UNUSED_RAM_SIZE[0] != 0) diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 5882e0ca4b..709e522fb7 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -39,7 +39,7 @@ #include "histogram.h" #include "sent.h" #include "trigger_central.h" -#include "svnversion.h" +#include "gitversion.h" #include "vvt.h" #include "trigger_emulator_algo.h" #include "boost_control.h" diff --git a/misc/jenkins/build_working_folder.sh b/misc/jenkins/build_working_folder.sh index 68f9ecbd7b..5e43254435 100755 --- a/misc/jenkins/build_working_folder.sh +++ b/misc/jenkins/build_working_folder.sh @@ -63,9 +63,6 @@ cp firmware/tunerstudio/generated/$INI_FILE_OVERRIDE $FOLDER INI_FILE_OVERRIDE="" RUSEFI_CONSOLE_SETTINGS="" -# users probably do not really care for this file -# cp firmware/svnversion.h $FOLDER - cp -r misc/install/STM32_Programmer_CLI $CONSOLE_FOLDER # 407 has additional version of firmware #cp firmware/deliver/rusefi_no_asserts.bin $FOLDER diff --git a/simulator/simulator/svnversion.h b/simulator/simulator/svnversion.h deleted file mode 100644 index 37225bdfbe..0000000000 --- a/simulator/simulator/svnversion.h +++ /dev/null @@ -1,6 +0,0 @@ - -// this is less important for simulator - -#ifndef VCS_VERSION -#define VCS_VERSION "simulator" -#endif diff --git a/unit_tests/global.h b/unit_tests/global.h index bd8ea2fc67..d6415cf77e 100644 --- a/unit_tests/global.h +++ b/unit_tests/global.h @@ -53,7 +53,6 @@ void chDbgAssert(int c, char *msg, void *arg); #define US_TO_NT_MULTIPLIER 100 -#define VCS_VERSION "321" #define RUS_EFI_VERSION_TAG "rusEfiVersion" #define INLINE inline