From f26a1eef6d4c9f46211ccfc80d0216b547d13e1b Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 24 Feb 2015 22:04:21 -0600 Subject: [PATCH] auto-sync --- firmware/console/status_loop.cpp | 10 ++++--- firmware/controllers/engine_controller.cpp | 5 ++-- firmware/controllers/flash_main.cpp | 2 +- firmware/hw_layer/hardware.cpp | 2 +- .../src/com/rusefi/EnduranceTest.java | 26 ++++++++++++++----- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 4206d0f97c..8d1f281ee1 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -486,13 +486,13 @@ static void blinkingThread(void *arg) { initialLedsBlink(); while (true) { - int delay; + int delay = isConsoleReady() ? 3 * blinkingPeriod : blinkingPeriod; +#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__) if (getNeedToWriteConfiguration()) { - delay = isConsoleReady() ? 6 * blinkingPeriod : 2 * blinkingPeriod; - } else { - delay = isConsoleReady() ? 3 * blinkingPeriod : blinkingPeriod; + delay = 2 * delay; } +#endif communicationPin.setValue(0); warningPin.setValue(0); @@ -574,7 +574,9 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC tsOutputChannels->egtValues.values[i] = getEgtValue(i); #endif /* EFI_MAX_31855 */ +#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__) tsOutputChannels->needBurn = getNeedToWriteConfiguration(); +#endif tsOutputChannels->hasSdCard = isSdCardAlive(); tsOutputChannels->isFuelPumpOn = enginePins.fuelPumpRelay.getLogicValue(); tsOutputChannels->isFanOn = enginePins.fanRelay.getLogicValue(); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index c114f881cd..f537600fd1 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -224,9 +224,10 @@ static void onEvenyGeneralMilliseconds(Engine *engine) { } #endif -#if (EFI_PROD_CODE && EFI_ENGINE_CONTROL )|| defined(__DOXYGEN__) - if (!engine->rpmCalculator.isRunning()) +#if (EFI_PROD_CODE && EFI_ENGINE_CONTROL && EFI_INTERNAL_FLASH) || defined(__DOXYGEN__) + if (!engine->rpmCalculator.isRunning()) { writeToFlashIfPending(); + } #endif if (versionForConfigurationListeners.isOld()) { diff --git a/firmware/controllers/flash_main.cpp b/firmware/controllers/flash_main.cpp index e2c08df85d..cd422cc6a0 100644 --- a/firmware/controllers/flash_main.cpp +++ b/firmware/controllers/flash_main.cpp @@ -18,7 +18,7 @@ #include "tunerstudio.h" #endif -#if EFI_INTERNAL_FLASH +#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__) #include "engine_controller.h" diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 926128c9f2..8c00f19c64 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -238,7 +238,7 @@ void initHardware(Logging *l, Engine *engine) { } #else engineConfiguration->engineType = DEFAULT_ENGINE_TYPE; - resetConfigurationExt(logger, engineConfiguration->engineType, engine); + resetConfigurationExt(sharedLogger, engineConfiguration->engineType, engine); #endif /* EFI_INTERNAL_FLASH */ if (hasFirmwareError()) { diff --git a/java_console/autotest/src/com/rusefi/EnduranceTest.java b/java_console/autotest/src/com/rusefi/EnduranceTest.java index 77610926c8..473b81cd83 100644 --- a/java_console/autotest/src/com/rusefi/EnduranceTest.java +++ b/java_console/autotest/src/com/rusefi/EnduranceTest.java @@ -1,11 +1,15 @@ package com.rusefi; -import static com.rusefi.AutoTest.setEngineType; +import static com.rusefi.IoUtil.sendCommand; +import static com.rusefi.IoUtil.sleep; import static com.rusefi.RealHwTest.startRealHardwareTest; public class EnduranceTest { - public static void main(String[] args) { + private static final int COUNT = 200; + + public static void main(String[] args) { + long start = System.currentTimeMillis(); try { String port = startRealHardwareTest(args); @@ -13,11 +17,15 @@ public class EnduranceTest { return; IoUtil.realHardwareConnect(port); - for (int i = 0; i < 1000; i++) { - setEngineType(3); - IoUtil.changeRpm(1200); - setEngineType(28); - IoUtil.changeRpm(2400); + for (int i = 0; i < COUNT; i++) { + AutoTest.currentEngineType = 3; + sendCommand("set_engine_type " + 3, AutoTest.COMPLEX_COMMAND_RETRY, 600); + sleep(2); + sendCommand("enable self_stimulation"); +// IoUtil.changeRpm(1200); + AutoTest.currentEngineType = 28; + sendCommand("set_engine_type " + 28, AutoTest.COMPLEX_COMMAND_RETRY, 600); + sleep(2); FileLog.MAIN.logLine("++++++++++++++++++++++++++++++++++++ " + i + " +++++++++++++++"); } @@ -25,5 +33,9 @@ public class EnduranceTest { e.printStackTrace(); System.exit(-1); } + FileLog.MAIN.logLine("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + FileLog.MAIN.logLine("++++++++++++++++++++++++++++++++++++ YES YES YES " + COUNT + " +++++++++++++++"); + FileLog.MAIN.logLine("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + FileLog.MAIN.logLine("In " + (System.currentTimeMillis() - start) + "ms"); } } \ No newline at end of file