Lua is new FSIO

This commit is contained in:
rusefi 2022-04-23 17:15:34 -04:00
parent 0b74e9db49
commit 3e6bc71e99
2 changed files with 11 additions and 11 deletions

View File

@ -170,14 +170,14 @@ static void doRunSolenoidBench(size_t humanIndex, float delay, float onTime, flo
&enginePins.tcuSolenoids[humanIndex - 1], engineConfiguration->tcu_solenoid[humanIndex - 1]); &enginePins.tcuSolenoids[humanIndex - 1], engineConfiguration->tcu_solenoid[humanIndex - 1]);
} }
static void doRunBenchTestLuaOutput(size_t /* humanIndex */, float /* delay */, float /* onTime */, float /* offTime */, int /* count */) { static void doRunBenchTestLuaOutput(size_t humanIndex, float /* delay */, float /* onTime */, float /* offTime */, int /* count */) {
// if (humanIndex < 1 || humanIndex > FSIO_COMMAND_COUNT) { if (humanIndex < 1 || humanIndex > LUA_PWM_COUNT) {
// efiPrintf("Invalid index: %d", humanIndex); efiPrintf("Invalid index: %d", humanIndex);
// return; return;
// } }
// todo: convert in lua bench test // todo: convert in lua bench test
// pinbench(delay, onTime, offTime, count, // pinbench(delay, onTime, offTime, count,
// &enginePins.fsioOutputs[humanIndex - 1], engineConfiguration->fsioOutputPins[humanIndex - 1]); // &enginePins.luaOutputPins[humanIndex - 1], engineConfiguration->luaOutputPins[humanIndex - 1]);
} }
/** /**
@ -222,8 +222,8 @@ static void tcuSolenoidBench(float delay, float humanIndex, float onTime, float
* delay 100, channel #1, 5ms ON, 1000ms OFF, repeat 3 times * delay 100, channel #1, 5ms ON, 1000ms OFF, repeat 3 times
* fsiobench2 100 1 5 1000 3 * fsiobench2 100 1 5 1000 3
*/ */
static void fsioBench2(float delay, float humanIndex, float onTime, float offTime, float count) { static void luaOutBench2(float delay, float humanIndex, float onTime, float offTime, float count) {
doRunBenchTestFsio((int)humanIndex, delay, onTime, offTime, (int)count); doRunBenchTestLuaOutput((int)humanIndex, delay, onTime, offTime, (int)count);
} }
static void fanBenchExt(float onTime) { static void fanBenchExt(float onTime) {
@ -472,7 +472,7 @@ void executeTSCommand(uint16_t subsystem, uint16_t index) {
} }
break; break;
case CMD_TS_LUA_OUT_CATEGORY: case CMD_TS_LUA_OUTPUT_CATEGORY:
if (!running) { if (!running) {
doRunBenchTestLuaOutput(index, 300.0, 4.0, doRunBenchTestLuaOutput(index, 300.0, 4.0,
engineConfiguration->benchTestOffTime, engineConfiguration->benchTestCount); engineConfiguration->benchTestOffTime, engineConfiguration->benchTestCount);
@ -570,7 +570,7 @@ void initBenchTest() {
addConsoleAction(CMD_MIL_BENCH, milBench); addConsoleAction(CMD_MIL_BENCH, milBench);
addConsoleAction(CMD_HPFP_BENCH, hpfpValveBench); addConsoleAction(CMD_HPFP_BENCH, hpfpValveBench);
addConsoleActionFFFFF("fsiobench2", fsioBench2); addConsoleActionFFFFF("luabench2", luaOutBench2);
instance.setPeriod(200 /*ms*/); instance.setPeriod(200 /*ms*/);
instance.Start(); instance.Start();
onConfigurationChangeBenchTest(); onConfigurationChangeBenchTest();

View File

@ -1938,7 +1938,7 @@ end_struct
#define CMD_TS_X14 20 #define CMD_TS_X14 20
! 0x16 ! 0x16
#define CMD_TS_BENCH_CATEGORY 22 #define CMD_TS_BENCH_CATEGORY 22
#define CMD_TS_LUA_OUT_CATEGORY 33 #define CMD_TS_LUA_OUTPUT_CATEGORY 33
#define CMD_TS_X31 49 #define CMD_TS_X31 49
#define CMD_TS_SOLENOID_CATEGORY 41 #define CMD_TS_SOLENOID_CATEGORY 41