From 645ea9573915d0dbba736094ca800201d3f2b651 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 24 Mar 2018 21:13:08 -0400 Subject: [PATCH] version into simulator output --- firmware/controllers/engine_controller.cpp | 20 ++++++++++++++++++++ firmware/rusefi.cpp | 18 ------------------ simulator/simulator/framework.cpp | 4 ---- simulator/simulator/rusEfiFunctionalTest.cpp | 4 +++- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 413629334d..e94c088d99 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -712,3 +712,23 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) initTachometer(); #endif /* EFI_PROD_CODE */ } + +static char UNUSED_RAM_SIZE[7000]; + +static char UNUSED_CCM_SIZE[7000] CCM_OPTIONAL; + +/** + * See also VCS_VERSION + */ +int getRusEfiVersion(void) { + if (UNUSED_RAM_SIZE[0] != 0) + return 123; // this is here to make the compiler happy about the unused array + if (UNUSED_CCM_SIZE[0] * 0 != 0) + return 3211; // this is here to make the compiler happy about the unused array +#if defined(EFI_BOOTLOADER_INCLUDE_CODE) || defined(__DOXYGEN__) + // make bootloader code happy too + if (initBootloader() != 0) + return 123; +#endif /* EFI_BOOTLOADER_INCLUDE_CODE */ + return 20180322; +} diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 6d28908d65..bcfb81d248 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -259,22 +259,4 @@ void chDbgStackOverflowPanic(thread_t *otp) { chDbgPanic3(panicMessage, __FILE__, __LINE__); } -static char UNUSED_RAM_SIZE[7000]; -static char UNUSED_CCM_SIZE[14000] CCM_OPTIONAL; - -/** - * See also VCS_VERSION - */ -int getRusEfiVersion(void) { - if (UNUSED_RAM_SIZE[0] != 0) - return 123; // this is here to make the compiler happy about the unused array - if (UNUSED_CCM_SIZE[0] * 0 != 0) - return 3211; // this is here to make the compiler happy about the unused array -#if defined(EFI_BOOTLOADER_INCLUDE_CODE) || defined(__DOXYGEN__) - // make bootloader code happy too - if (initBootloader() != 0) - return 123; -#endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20180322; -} diff --git a/simulator/simulator/framework.cpp b/simulator/simulator/framework.cpp index f650523dfe..1cdbc596de 100644 --- a/simulator/simulator/framework.cpp +++ b/simulator/simulator/framework.cpp @@ -26,10 +26,6 @@ efitimesec_t getTimeNowSeconds(void) { return currentTimeMillis() / CH_CFG_ST_FREQUENCY; } -int getRusEfiVersion(void) { - return 239; -} - static size_t wt_writes(void *ip, const uint8_t *bp, size_t n) { printToWin32Console((char*)bp); return CONSOLE_PORT->vmt->write(CONSOLE_PORT, bp, n); diff --git a/simulator/simulator/rusEfiFunctionalTest.cpp b/simulator/simulator/rusEfiFunctionalTest.cpp index 9061811674..085994eec0 100644 --- a/simulator/simulator/rusEfiFunctionalTest.cpp +++ b/simulator/simulator/rusEfiFunctionalTest.cpp @@ -95,7 +95,9 @@ static void runChprintfTest() { void rusEfiFunctionalTest(void) { printToWin32Console("Running version:"); - printToWin32Console("TODO"); + static char versionBuffer[20]; + itoa10(versionBuffer, (int)getRusEfiVersion()); + printToWin32Console(versionBuffer); initIntermediateLoggingBuffer(); initErrorHandling();