rusefi-1/firmware/controllers/bench_test.cpp

581 lines
16 KiB
C++
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file bench_test.cpp
* @brief Utility methods related to bench testing.
2015-07-10 06:01:56 -07:00
*
*
* @date Sep 8, 2013
2020-01-13 18:57:43 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
// todo: rename this file
#include "pch.h"
2015-07-10 06:01:56 -07:00
2019-04-12 19:07:03 -07:00
#if EFI_ENGINE_CONTROL
#if !EFI_UNIT_TEST
2015-07-10 06:01:56 -07:00
#include "os_access.h"
#include "flash_main.h"
#include "bench_test.h"
2015-07-10 06:01:56 -07:00
#include "main_trigger_callback.h"
2019-01-13 16:41:39 -08:00
#include "idle_thread.h"
#include "periodic_thread_controller.h"
#include "electronic_throttle.h"
2020-03-24 16:50:04 -07:00
#include "cj125.h"
#include "malfunction_central.h"
#include "trigger_emulator_algo.h"
2021-03-11 19:42:59 -08:00
#include "microsecond_timer.h"
2022-01-03 11:21:54 -08:00
#include "gpio_ext.h"
2019-09-05 07:30:27 -07:00
#if EFI_WIDEBAND_FIRMWARE_UPDATE
#include "rusefi_wideband.h"
2021-03-11 19:42:59 -08:00
#endif // EFI_WIDEBAND_FIRMWARE_UPDATE
#if EFI_PROD_CODE
#include "rusefi.h"
2019-08-03 16:58:38 -07:00
#include "mpu_util.h"
#endif /* EFI_PROD_CODE */
2015-07-10 06:01:56 -07:00
2019-09-05 07:30:27 -07:00
#if (BOARD_TLE8888_COUNT > 0)
#include "gpio/tle8888.h"
2021-03-11 19:42:59 -08:00
#endif // BOARD_TLE8888_COUNT
2019-09-05 07:30:27 -07:00
2016-01-11 14:01:33 -08:00
static bool isRunningBench = false;
2015-07-10 06:01:56 -07:00
2016-01-11 14:01:33 -08:00
bool isRunningBenchTest(void) {
2015-07-10 06:01:56 -07:00
return isRunningBench;
}
static scheduling_s benchSchedStart;
static scheduling_s benchSchedEnd;
2022-01-03 16:57:34 -08:00
static void benchOn(OutputPin* output) {
output->setValue(true);
}
2022-01-03 11:21:54 -08:00
static char pin_error[64];
2022-01-03 16:57:34 -08:00
static void benchOff(OutputPin* output) {
#if EFI_PROD_CODE && (BOARD_EXT_GPIOCHIPS > 0)
2022-01-03 11:21:54 -08:00
brain_pin_diag_e diag = gpiochips_getDiag(output->brainPin);
2022-01-03 13:46:15 -08:00
if (diag == PIN_INVALID) {
efiPrintf("No Diag on this pin");
2022-01-03 11:21:54 -08:00
} else {
pinDiag2string(pin_error, sizeof(pin_error), diag);
efiPrintf("Diag says %s", pin_error);
}
2022-01-03 13:46:15 -08:00
#endif // EFI_PROD_CODE
output->setValue(false);
}
static void runBench(brain_pin_e brainPin, OutputPin *output, float startDelayMs, float onTimeMs, float offTimeMs,
2015-07-10 06:01:56 -07:00
int count) {
int startDelayUs = MS2US(maxF(0.1, startDelayMs));
int onTimeUs = MS2US(maxF(0.1, onTimeMs));
int offTimeUs = MS2US(maxF(0.1, offTimeMs));
if (onTimeUs > TOO_FAR_INTO_FUTURE_US) {
2021-10-02 22:30:42 -07:00
firmwareError(CUSTOM_ERR_BENCH_PARAM, "onTime above limit %dus", TOO_FAR_INTO_FUTURE_US);
return;
}
efiPrintf("Running bench: ON_TIME=%d us OFF_TIME=%d us Counter=%d", onTimeUs, offTimeUs, count);
efiPrintf("output on %s", hwPortname(brainPin));
2015-07-10 06:01:56 -07:00
chThdSleepMicroseconds(startDelayUs);
2015-07-10 06:01:56 -07:00
isRunningBench = true;
2015-07-10 06:01:56 -07:00
for (int i = 0; i < count; i++) {
engine->outputChannels.testBenchIter = i;
efitick_t nowNt = getTimeNowNt();
// start in a short time so the scheduler can precisely schedule the start event
efitick_t startTime = nowNt + US2NT(50);
efitick_t endTime = startTime + US2NT(onTimeUs);
// Schedule both events
engine->executor.scheduleByTimestampNt("bstart", &benchSchedStart, startTime, {benchOn, output});
engine->executor.scheduleByTimestampNt("bend", &benchSchedEnd, endTime, {benchOff, output});
// Wait one full cycle time for the event + delay to happen
chThdSleepMicroseconds(onTimeUs + offTimeUs);
2015-07-10 06:01:56 -07:00
}
/* last */
engine->outputChannels.testBenchIter++;
2022-01-03 11:21:54 -08:00
efiPrintf("Done!");
2015-07-10 06:01:56 -07:00
isRunningBench = false;
}
2017-07-24 16:38:00 -07:00
static volatile bool isBenchTestPending = false;
static bool widebandUpdatePending = false;
2015-07-10 06:01:56 -07:00
static float onTime;
static float offTime;
static float startDelayMs;
2015-07-10 06:01:56 -07:00
static int count;
static brain_pin_e brainPin;
static OutputPin* pinX;
static void pinbench(float startdelay, float ontime, float offtime, int iterations,
OutputPin* pinParam, brain_pin_e brainPinParam)
{
startDelayMs = startdelay;
onTime = ontime;
offTime = offtime;
count = iterations;
2015-07-10 06:01:56 -07:00
pinX = pinParam;
brainPin = brainPinParam;
// let's signal bench thread to wake up
isBenchTestPending = true;
2015-07-10 06:01:56 -07:00
}
/*==========================================================================*/
static void doRunFuelInjBench(size_t humanIndex, float delay, float onTime, float offTime, int count) {
2016-03-14 21:01:37 -07:00
if (humanIndex < 1 || humanIndex > engineConfiguration->specs.cylindersCount) {
efiPrintf("Invalid index: %d", humanIndex);
2016-03-14 21:01:37 -07:00
return;
}
pinbench(delay, onTime, offTime, count,
&enginePins.injectors[humanIndex - 1], engineConfiguration->injectionPins[humanIndex - 1]);
2016-03-14 21:01:37 -07:00
}
static void doRunSparkBench(size_t humanIndex, float delay, float onTime, float offTime, int count) {
if (humanIndex < 1 || humanIndex > engineConfiguration->specs.cylindersCount) {
efiPrintf("Invalid index: %d", humanIndex);
return;
}
pinbench(delay, onTime, offTime, count,
&enginePins.coils[humanIndex - 1], engineConfiguration->ignitionPins[humanIndex - 1]);
}
static void doRunSolenoidBench(size_t humanIndex, float delay, float onTime, float offTime, int count) {
if (humanIndex < 1 || humanIndex > TCU_SOLENOID_COUNT) {
efiPrintf("Invalid index: %d", humanIndex);
return;
}
pinbench(delay, onTime, offTime, count,
&enginePins.tcuSolenoids[humanIndex - 1], engineConfiguration->tcu_solenoid[humanIndex - 1]);
}
2022-04-23 14:15:34 -07:00
static void doRunBenchTestLuaOutput(size_t humanIndex, float /* delay */, float /* onTime */, float /* offTime */, int /* count */) {
if (humanIndex < 1 || humanIndex > LUA_PWM_COUNT) {
efiPrintf("Invalid index: %d", humanIndex);
return;
}
2021-11-14 05:37:50 -08:00
// todo: convert in lua bench test
// pinbench(delay, onTime, offTime, count,
2022-04-23 14:15:34 -07:00
// &enginePins.luaOutputPins[humanIndex - 1], engineConfiguration->luaOutputPins[humanIndex - 1]);
}
2015-07-10 06:01:56 -07:00
/**
* delay 100, cylinder #2, 5ms ON, 1000ms OFF, repeat 3 times
* fuelInjBenchExt 100 2 5 1000 3
*/
static void fuelInjBenchExt(float delay, float humanIndex, float onTime, float offTime, float count) {
doRunFuelInjBench((int)humanIndex, delay, onTime, offTime, (int)count);
}
/**
* fuelbench 5 1000 2
*/
static void fuelInjBench(float onTime, float offTime, float count) {
fuelInjBenchExt(0.0, 1, onTime, offTime, count);
}
/**
* sparkbench2 0 1 5 1000 2
*/
static void sparkBenchExt(float delay, float humanIndex, float onTime, float offTime, float count) {
doRunSparkBench((int)humanIndex, delay, onTime, offTime, (int)count);
}
/**
* sparkbench 5 400 2
* 5 ms ON, 400 ms OFF, two times
2015-07-10 06:01:56 -07:00
*/
static void sparkBench(float onTime, float offTime, float count) {
sparkBenchExt(0.0, 1, onTime, offTime, count);
2015-07-10 06:01:56 -07:00
}
/**
* delay 100, solenoid #2, 1000ms ON, 1000ms OFF, repeat 3 times
* tcusolbench 100 2 1000 1000 3
*/
static void tcuSolenoidBench(float delay, float humanIndex, float onTime, float offTime, float count) {
doRunSolenoidBench((int)humanIndex, delay, onTime, offTime, (int)count);
}
/**
* delay 100, channel #1, 5ms ON, 1000ms OFF, repeat 3 times
* fsiobench2 100 1 5 1000 3
*/
2022-04-23 14:15:34 -07:00
static void luaOutBench2(float delay, float humanIndex, float onTime, float offTime, float count) {
doRunBenchTestLuaOutput((int)humanIndex, delay, onTime, offTime, (int)count);
}
static void fanBenchExt(float onTime) {
pinbench(0.0, onTime, 100.0, 1.0,
&enginePins.fanRelay, engineConfiguration->fanPin);
2017-07-24 17:40:01 -07:00
}
2015-07-10 06:01:56 -07:00
void fanBench(void) {
fanBenchExt(3000.0);
2015-07-10 06:01:56 -07:00
}
2021-06-23 14:16:11 -07:00
void fan2Bench(void) {
pinbench(0.0, 3000.0, 100.0, 1.0,
&enginePins.fanRelay2, engineConfiguration->fan2Pin);
2021-06-23 14:16:11 -07:00
}
2019-01-13 16:41:39 -08:00
/**
* we are blinking for 16 seconds so that one can click the button and walk around to see the light blinking
*/
2015-07-10 06:01:56 -07:00
void milBench(void) {
pinbench(0.0, 500.0, 500.0, 16,
&enginePins.checkEnginePin, engineConfiguration->malfunctionIndicatorPin);
2015-07-10 06:01:56 -07:00
}
2020-03-29 14:21:17 -07:00
void starterRelayBench(void) {
pinbench(0.0, 6000.0, 100.0, 1,
&enginePins.starterControl, engineConfiguration->starterControlPin);
2020-03-29 14:21:17 -07:00
}
static void fuelPumpBenchExt(float durationMs) {
pinbench(0.0, durationMs, 100.0, 1.0,
&enginePins.fuelPumpRelay, engineConfiguration->fuelPumpPin);
2016-01-07 18:02:35 -08:00
}
2019-09-14 14:56:17 -07:00
void acRelayBench(void) {
pinbench(0.0, 1000.0, 100.0, 1,
&enginePins.acRelay, engineConfiguration->acRelayPin);
2019-09-14 14:56:17 -07:00
}
static void mainRelayBench(void) {
2021-01-10 20:46:50 -08:00
// main relay is usually "ON" via FSIO thus bench testing that one is pretty unusual
engine->mainRelayBenchStartNt = getTimeNowNt();
}
static void hpfpValveBench(void) {
pinbench(1000.0, 20.0, engineConfiguration->benchTestOffTime, engineConfiguration->benchTestCount,
&enginePins.hpfpValve, engineConfiguration->hpfpValvePin);
2020-11-21 21:09:36 -08:00
}
2015-07-10 06:01:56 -07:00
void fuelPumpBench(void) {
fuelPumpBenchExt(3000.0);
2015-07-10 06:01:56 -07:00
}
2019-02-10 20:54:41 -08:00
class BenchController : public PeriodicController<UTILITY_THREAD_STACK_SIZE> {
public:
2019-02-11 12:09:24 -08:00
BenchController() : PeriodicController("BenchThread") { }
2019-02-10 20:54:41 -08:00
private:
void PeriodicTask(efitick_t nowNt) override {
UNUSED(nowNt);
2019-04-25 15:49:16 -07:00
setPeriod(50 /* ms */);
2017-04-24 19:35:16 -07:00
validateStack("Bench", STACK_USAGE_BENCH, 128);
2017-07-24 16:38:00 -07:00
// naive inter-thread communication - waiting for a flag
2019-02-10 20:54:41 -08:00
if (isBenchTestPending) {
isBenchTestPending = false;
runBench(brainPin, pinX, startDelayMs, onTime, offTime, count);
2015-07-10 06:01:56 -07:00
}
if (widebandUpdatePending) {
#if EFI_WIDEBAND_FIRMWARE_UPDATE && EFI_CAN_SUPPORT
updateWidebandFirmware();
#endif
widebandUpdatePending = false;
}
2015-07-10 06:01:56 -07:00
}
2019-02-10 20:54:41 -08:00
};
static BenchController instance;
2015-07-10 06:01:56 -07:00
static void handleBenchCategory(uint16_t index) {
switch(index) {
case BENCH_MAIN_RELAY:
mainRelayBench();
return;
case BENCH_HPFP_VALVE:
2020-11-21 21:13:55 -08:00
hpfpValveBench();
return;
case BENCH_FUEL_PUMP:
// cmd_test_fuel_pump
fuelPumpBench();
return;
case BENCH_STARTER_ENABLE_RELAY:
starterRelayBench();
return;
case BENCH_CHECK_ENGINE_LIGHT:
// cmd_test_check_engine_light
milBench();
return;
case BENCH_AC_COMPRESSOR_RELAY:
acRelayBench();
return;
case BENCH_FAN_RELAY:
fanBench();
return;
2021-11-11 17:27:45 -08:00
case BENCH_IDLE_VALVE:
// cmd_test_idle_valve
#if EFI_IDLE_CONTROL
startIdleBench();
#endif /* EFI_IDLE_CONTROL */
return;
case BENCH_FAN_RELAY_2:
2021-06-23 14:16:11 -07:00
fan2Bench();
return;
default:
firmwareError(OBD_PCM_Processor_Fault, "Unexpected bench function %d", index);
}
}
2019-04-23 20:20:14 -07:00
static void handleCommandX14(uint16_t index) {
switch (index) {
case TS_GRAB_TPS_CLOSED:
2019-04-29 22:21:09 -07:00
grabTPSIsClosed();
return;
case TS_GRAB_TPS_WOT:
2019-04-29 22:21:09 -07:00
grabTPSIsWideOpen();
return;
2019-09-05 07:30:27 -07:00
// case 4: tps2_closed
// case 5: tps2_wot
case TS_GRAB_PEDAL_UP:
2019-04-30 15:46:39 -07:00
grabPedalIsUp();
return;
case TS_GRAB_PEDAL_WOT:
2019-04-30 15:46:39 -07:00
grabPedalIsWideOpen();
return;
case TS_RESET_TLE8888:
2019-09-05 07:30:27 -07:00
#if (BOARD_TLE8888_COUNT > 0)
Tle8888 big update 1 (#1892) * smart gpio: fix tle8888 direct pin mapping for MRE * MRE: use TLE8888 pins instead of MCU gpios that drives TLE8888 * TLE8888: cleanup * TLE8888: do not reset driver private data on WD/undervoltage reset * TLE8888: diagnostic updates * TLE8888 driver: BIG driver rework * TLE8888: check SPI answers for abnormal states Reply with other than requested register can be a sign of: -Power-On-Reset, then OpStat0 will be replyed -WatchDog reset, then FWDStat1 will be replyed -Invalid communication frame, then Diag0 will be replyed Keep tracking last accessed register and check with the next reply. * TLE8888: debug clean-up * TLE8888: implement spi array write This reduce CS inactive state time between two consequent accesses from 8.8 uS to 1.4 uS * TLE8888: fix PP outputs in OD mode * TLE8888: cleanup register definitions * TLE8888: run separate driver thread for each chip instance Calculating poll interval for few chips become more complex, avoid this running thread for each device. * TLE8888: fix cypress and kinetic compilation Both platforms define its own MAX and cause redifination error if common.h is included in driver. * MRE: update mapping.yaml and fix direct pin mapping for TLE8888 * TLE8888: diagnnostic: disable switch off in case of overcurrent For all output, use current limiting instead * TLE8888: check for overvoltage on OUT8..OUT13 * TLE8888: add TODO note about how to recover from failure condition Currently TLE8888 automaticly recovers only from overcurrent and (may be) overtemperature conditions. Short to bat cause output disable (bit in OECONFIG is reset) and needs driver/host intervention. * TLE8888: save few bytes of RAM * TLE8888: Lada Kalina is test mule for IDLE stepper on TLE8888 Don't forget to enable PP mode for TLE8888 outputs 21..24: uncomment line 1087 in tle8888.c * TLE8888: reorder code, cleanup * TLE8888: mode all debug/statisctic to per-chip struct * TLE8888: rework poll interval calculation * MRE: use TLE8888 pins instead of MCU gpios that drives TLE8888 #2
2020-10-23 09:25:30 -07:00
tle8888_req_init();
2019-09-05 07:30:27 -07:00
#endif
return;
2020-03-29 14:21:17 -07:00
case 0xA:
// cmd_write_config
#if EFI_INTERNAL_FLASH
writeToFlashNow();
#endif /* EFI_INTERNAL_FLASH */
return;
#if EFI_EMULATE_POSITION_SENSORS
case 0xD:
enableTriggerStimulator();
return;
case 0xF:
disableTriggerStimulator();
return;
case 0x13:
enableExternalTriggerStimulator();
return;
#endif // EFI_EMULATE_POSITION_SENSORS
#if EFI_ELECTRONIC_THROTTLE_BODY
case 0xE:
etbAutocal(0);
return;
case 0x11:
etbAutocal(1);
return;
case 0xC:
engine->etbAutoTune = true;
return;
case 0x10:
engine->etbAutoTune = false;
2020-07-26 15:24:02 -07:00
#if EFI_TUNER_STUDIO
engine->outputChannels.calibrationMode = (uint8_t)TsCalMode::None;
2020-07-26 15:24:02 -07:00
#endif // EFI_TUNER_STUDIO
return;
#endif
case 0x12:
widebandUpdatePending = true;
return;
2021-07-20 10:20:34 -07:00
case 0x14:
#ifdef STM32F7
void sys_dual_bank(void);
2021-07-20 11:23:45 -07:00
/**
* yes, this would instantly cause a hard fault as a random sequence of bytes is decoded as instructions
* and that's the intended behavious - the point is to set flash properly and to re-flash once in proper configuration
*/
2021-07-20 10:20:34 -07:00
sys_dual_bank();
2021-07-20 11:23:45 -07:00
rebootNow();
2021-07-20 10:20:34 -07:00
#else
firmwareError(OBD_PCM_Processor_Fault, "Unexpected dbank command", index);
#endif
return;
2021-08-10 04:11:41 -07:00
case 0x15:
2021-08-10 04:29:55 -07:00
#if EFI_PROD_CODE
2021-08-10 04:11:41 -07:00
extern bool burnWithoutFlash;
burnWithoutFlash = true;
2021-08-10 04:29:55 -07:00
#endif // EFI_PROD_CODE
2021-08-10 04:11:41 -07:00
return;
default:
firmwareError(OBD_PCM_Processor_Fault, "Unexpected bench x14 %d", index);
2019-04-23 20:20:14 -07:00
}
}
extern bool rebootForPresetPending;
static void fatalErrorForPresetApply() {
rebootForPresetPending = true;
firmwareError(OBD_PCM_Processor_Fault,
"\n\nTo complete preset apply:\n"
" 1. Close TunerStudio\n"
" 2. Power cycle ECU\n"
" 3. Open TunerStudio and reconnect\n\n");
}
2019-03-12 17:33:13 -07:00
void executeTSCommand(uint16_t subsystem, uint16_t index) {
efiPrintf("IO test subsystem=%d index=%d", subsystem, index);
2016-03-14 20:01:43 -07:00
bool running = !engine->rpmCalculator.isStopped();
switch (subsystem) {
case TS_CLEAR_WARNINGS:
clearWarnings();
break;
case TS_DEBUG_MODE:
engineConfiguration->debugMode = (debug_mode_e)index;
break;
case TS_IGNITION_CATEGORY:
if (!running) {
/* WARN: fixed charge time */
doRunSparkBench(index, 300.0, 4.0,
engineConfiguration->benchTestOffTime, engineConfiguration->benchTestCount);
}
break;
case TS_INJECTOR_CATEGORY:
if (!running) {
doRunFuelInjBench(index, 300.0 , engineConfiguration->benchTestOnTime,
engineConfiguration->benchTestOffTime, engineConfiguration->benchTestCount);
}
break;
case CMD_TS_SOLENOID_CATEGORY:
if (!running) {
doRunSolenoidBench(index, 300.0, 1000.0,
1000.0, engineConfiguration->benchTestCount);
}
break;
2022-04-23 14:15:34 -07:00
case CMD_TS_LUA_OUTPUT_CATEGORY:
if (!running) {
2022-04-23 14:02:50 -07:00
doRunBenchTestLuaOutput(index, 300.0, 4.0,
engineConfiguration->benchTestOffTime, engineConfiguration->benchTestCount);
}
break;
case TS_X14:
2019-04-23 20:20:14 -07:00
handleCommandX14(index);
break;
#if defined(EFI_WIDEBAND_FIRMWARE_UPDATE) && EFI_CAN_SUPPORT
case 0x15:
setWidebandOffset(index);
break;
#endif // EFI_WIDEBAND_FIRMWARE_UPDATE && EFI_CAN_SUPPORT
case CMD_TS_BENCH_CATEGORY:
handleBenchCategory(index);
break;
2021-11-11 17:27:45 -08:00
case TS_UNUSED_CJ125_CALIB:
2020-04-08 20:14:21 -07:00
#if EFI_CJ125 && HAL_USE_SPI
2020-05-01 17:22:49 -07:00
cjStartCalibration();
2020-03-24 16:50:04 -07:00
#endif /* EFI_CJ125 */
break;
2021-11-11 17:27:45 -08:00
case TS_CRAZY:
if (index == 0x3456) {
// call to pit
setCallFromPitStop(30000);
}
break;
case 0x30:
fatalErrorForPresetApply();
2019-01-20 19:17:06 -08:00
setEngineType(index);
break;
case CMD_TS_X31:
fatalErrorForPresetApply();
2019-03-12 17:33:13 -07:00
setEngineType(DEFAULT_ENGINE_TYPE);
break;
case 0x79:
2019-01-05 20:33:04 -08:00
scheduleStopEngine();
break;
case 0xba:
#if EFI_PROD_CODE
jump_to_bootloader();
#endif /* EFI_PROD_CODE */
break;
case 0xbb:
2019-06-23 06:46:14 -07:00
#if EFI_PROD_CODE
rebootNow();
#endif /* EFI_PROD_CODE */
break;
default:
firmwareError(OBD_PCM_Processor_Fault, "Unexpected bench subsystem %d %d", subsystem, index);
2016-03-14 21:01:37 -07:00
}
2016-03-14 20:01:43 -07:00
}
2022-01-03 00:35:26 -08:00
void onConfigurationChangeBenchTest() {
if (engineConfiguration->benchTestOffTime < 5)
engineConfiguration->benchTestOffTime = 500; // default value if configuration was not specified
if (engineConfiguration->benchTestCount < 1)
2022-01-03 11:21:54 -08:00
engineConfiguration->benchTestCount = 3; // default value if configuration was not specified
2022-01-03 00:35:26 -08:00
}
void initBenchTest() {
2015-07-10 06:01:56 -07:00
addConsoleAction("fuelpumpbench", fuelPumpBench);
addConsoleActionF("fuelpumpbench2", fuelPumpBenchExt);
addConsoleActionFFF(CMD_FUEL_BENCH, fuelInjBench);
addConsoleActionFFFFF("fuelbench2", fuelInjBenchExt);
addConsoleActionFFF(CMD_SPARK_BENCH, sparkBench);
addConsoleActionFFFFF("sparkbench2", sparkBenchExt);
addConsoleActionFFFFF("tcusolbench", tcuSolenoidBench);
2021-06-23 14:16:11 -07:00
addConsoleAction(CMD_AC_RELAY_BENCH, acRelayBench);
2021-06-23 14:16:11 -07:00
addConsoleAction(CMD_FAN_BENCH, fanBench);
addConsoleAction(CMD_FAN2_BENCH, fan2Bench);
addConsoleActionF("fanbench2", fanBenchExt);
2021-01-10 17:30:08 -08:00
addConsoleAction("mainrelaybench", mainRelayBench);
#if EFI_WIDEBAND_FIRMWARE_UPDATE && EFI_CAN_SUPPORT
addConsoleAction("update_wideband", []() { widebandUpdatePending = true; });
addConsoleActionI("set_wideband_index", [](int index) { setWidebandOffset(index); });
#endif // EFI_WIDEBAND_FIRMWARE_UPDATE && EFI_CAN_SUPPORT
2015-07-10 06:01:56 -07:00
2020-08-19 18:05:08 -07:00
addConsoleAction(CMD_STARTER_BENCH, starterRelayBench);
addConsoleAction(CMD_MIL_BENCH, milBench);
2020-11-21 21:47:43 -08:00
addConsoleAction(CMD_HPFP_BENCH, hpfpValveBench);
2015-07-10 06:01:56 -07:00
2022-04-23 14:15:34 -07:00
addConsoleActionFFFFF("luabench2", luaOutBench2);
2019-02-10 20:54:41 -08:00
instance.setPeriod(200 /*ms*/);
instance.Start();
2022-01-03 00:35:26 -08:00
onConfigurationChangeBenchTest();
2015-07-10 06:01:56 -07:00
}
#endif /* EFI_UNIT_TEST */
2015-07-10 06:01:56 -07:00
#endif