From d37c5c54a2efb3dcc07961d77930ffce716c922b Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 13 Jan 2019 19:41:39 -0500 Subject: [PATCH] idle bench test from TS --- firmware/console/binary/tunerstudio.cpp | 2 +- firmware/controllers/idle_thread.cpp | 3 +++ firmware/controllers/injector_central.cpp | 10 +++++++++- firmware/controllers/injector_central.h | 2 +- firmware/tunerstudio/rusefi.input | 4 ++-- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index b2c3735b2a..be49f87b20 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -774,7 +774,7 @@ int tunerStudioHandleCrcCommand(ts_channel_s *tsChannel, char *data, int incomin } #if EFI_PROD_CODE || defined(__DOXYGEN__) - runIoTest(subsystem, index); + runBenchTest(subsystem, index); #endif /* EFI_PROD_CODE */ sendOkResponse(tsChannel, TS_CRC); } else { diff --git a/firmware/controllers/idle_thread.cpp b/firmware/controllers/idle_thread.cpp index 224d2d91ae..c3e6bc4c34 100644 --- a/firmware/controllers/idle_thread.cpp +++ b/firmware/controllers/idle_thread.cpp @@ -429,6 +429,9 @@ void onConfigurationChangeIdleCallback(engine_configuration_s *previousConfigura idleSolenoid.setFrequency(CONFIGB(idle).solenoidFrequency); } +/** + * Idle test would activate the solenoid for three seconds + */ void startIdleBench(void) { timeToStopIdleTest = getTimeNowUs() + MS2US(3000); // 3 seconds scheduleMsg(logger, "idle valve bench test"); diff --git a/firmware/controllers/injector_central.cpp b/firmware/controllers/injector_central.cpp index 9bba0fbfbb..6040b6f17b 100644 --- a/firmware/controllers/injector_central.cpp +++ b/firmware/controllers/injector_central.cpp @@ -33,6 +33,7 @@ #include "pin_repository.h" #include "efiGpio.h" #include "settings.h" +#include "idle_thread.h" EXTERN_ENGINE ; @@ -161,6 +162,9 @@ void fanBench(void) { fanBenchExt("3000"); } +/** + * we are blinking for 16 seconds so that one can click the button and walk around to see the light blinking + */ void milBench(void) { pinbench("0", "500", "500", "16", &enginePins.checkEnginePin, CONFIGB(malfunctionIndicatorPin)); } @@ -240,7 +244,7 @@ void OutputPin::unregisterOutput(brain_pin_e oldPin, brain_pin_e newPin) { } } -void runIoTest(int subsystem, int index) { +void runBenchTest(int subsystem, int index) { scheduleMsg(logger, "IO test subsystem=%d index=%d", subsystem, index); if (subsystem == 0x12) { @@ -248,12 +252,16 @@ void runIoTest(int subsystem, int index) { } else if (subsystem == 0x13) { doRunFuel(index, "300", "4", "400", "3"); } else if (subsystem == 0x14) { + // cmd_test_fuel_pump fuelPumpBench(); } else if (subsystem == 0x15) { fanBench(); } else if (subsystem == 0x16) { + // cmd_test_check_engine_light milBench(); } else if (subsystem == 0x17) { + // cmd_test_idle_valve + startIdleBench(); } else if (subsystem == 0x20 && index == 0x3456) { // call to pit setCallFromPitStop(30000); diff --git a/firmware/controllers/injector_central.h b/firmware/controllers/injector_central.h index 06663ce228..cd03f82bd1 100644 --- a/firmware/controllers/injector_central.h +++ b/firmware/controllers/injector_central.h @@ -20,6 +20,6 @@ void milBench(void); void initInjectorCentral(Logging *sharedLogger); bool isRunningBenchTest(void); -void runIoTest(int subsystem, int index); +void runBenchTest(int subsystem, int index); #endif /* INJECTOR_CENTRAL_H_ */ diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 80edd3fdfc..209bcb9e68 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1126,7 +1126,7 @@ menuDialog = main subMenu = monitoringSettings, "rusEfi Console Settings" subMenu = std_separator subMenu = connection, "Connection" - subMenu = ioTest, "I-O Test" + subMenu = ioTest, "Bench Test" subMenu = allPins, "Full pinout" [ControllerCommands] @@ -2215,7 +2215,7 @@ cmd_stop_engine = "w\x00\x99\x00\x00" commandButton = "Stop Engine", cmd_stop_engine ; bench test - dialog = ioTest, "I-O Test", border + dialog = ioTest, "Bench Test", border panel = testSpark, West panel = testInjectors, Center panel = testMisc, East