From 35120e07daea3da50bba16c243aa703709d4187f Mon Sep 17 00:00:00 2001 From: rusefi Date: Wed, 24 Aug 2022 12:02:22 -0400 Subject: [PATCH] refactoring --- .../controllers/algo/auto_generated_enginetypes.cpp | 6 ++++-- firmware/controllers/algo/engine_types.h | 7 +++++-- firmware/controllers/bench_test.cpp | 12 ++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/firmware/controllers/algo/auto_generated_enginetypes.cpp b/firmware/controllers/algo/auto_generated_enginetypes.cpp index aab76bac85..81d3d66e90 100644 --- a/firmware/controllers/algo/auto_generated_enginetypes.cpp +++ b/firmware/controllers/algo/auto_generated_enginetypes.cpp @@ -525,6 +525,8 @@ case TS_COMMAND_1: return "TS_COMMAND_1"; case TS_COMMAND_11: return "TS_COMMAND_11"; +case TS_LUA_OUTPUT_CATEGORY: +case TS_SOLENOID_CATEGORY: case TS_COMMAND_12: return "TS_COMMAND_12"; case TS_COMMAND_13: @@ -571,9 +573,9 @@ case TS_UNUSED_28: return "TS_UNUSED_28"; case TS_UNUSED_29: return "TS_UNUSED_29"; -case TS_UNUSED_30: +case TS_X30: return "TS_UNUSED_30"; -case TS_UNUSED_31: +case TS_X31: return "TS_UNUSED_31"; case TS_UNUSED_CJ125_CALIB: return "TS_UNUSED_CJ125_CALIB"; diff --git a/firmware/controllers/algo/engine_types.h b/firmware/controllers/algo/engine_types.h index e797d22728..cca29b7e7a 100644 --- a/firmware/controllers/algo/engine_types.h +++ b/firmware/controllers/algo/engine_types.h @@ -540,6 +540,7 @@ typedef enum { TS_IGNITION_CATEGORY = 18, TS_INJECTOR_CATEGORY = 19, TS_X14 = 20, + // 0x15 TS_WIDEBAND = 21, TS_BENCH_CATEGORY = 22, TS_UNUSED_23 = 23, @@ -549,9 +550,11 @@ typedef enum { TS_UNUSED_27 = 27, TS_UNUSED_28 = 28, TS_UNUSED_29 = 29, - TS_UNUSED_30 = 30, - TS_UNUSED_31 = 31, + TS_X30 = 30, + TS_X31 = 31, TS_CRAZY = 32, + TS_LUA_OUTPUT_CATEGORY = 33, + TS_SOLENOID_CATEGORY = 41, } ts_command_e; typedef enum { diff --git a/firmware/controllers/bench_test.cpp b/firmware/controllers/bench_test.cpp index d4c7689701..a82e28744e 100644 --- a/firmware/controllers/bench_test.cpp +++ b/firmware/controllers/bench_test.cpp @@ -464,14 +464,14 @@ void executeTSCommand(uint16_t subsystem, uint16_t index) { } break; - case CMD_TS_SOLENOID_CATEGORY: + case TS_SOLENOID_CATEGORY: if (!running) { doRunSolenoidBench(index, 300.0, 1000.0, 1000.0, engineConfiguration->benchTestCount); } break; - case CMD_TS_LUA_OUTPUT_CATEGORY: + case TS_LUA_OUTPUT_CATEGORY: if (!running) { doRunBenchTestLuaOutput(index, 300.0, 4.0, engineConfiguration->benchTestOffTime, engineConfiguration->benchTestCount); @@ -482,11 +482,11 @@ void executeTSCommand(uint16_t subsystem, uint16_t index) { handleCommandX14(index); break; #if defined(EFI_WIDEBAND_FIRMWARE_UPDATE) && EFI_CAN_SUPPORT - case 0x15: + case TS_WIDEBAND: setWidebandOffset(index); break; #endif // EFI_WIDEBAND_FIRMWARE_UPDATE && EFI_CAN_SUPPORT - case CMD_TS_BENCH_CATEGORY: + case TS_BENCH_CATEGORY: handleBenchCategory(index); break; @@ -503,12 +503,12 @@ void executeTSCommand(uint16_t subsystem, uint16_t index) { } break; - case 0x30: + case TS_X30: fatalErrorForPresetApply(); setEngineType(index); break; - case CMD_TS_X31: + case TS_X31: fatalErrorForPresetApply(); setEngineType(DEFAULT_ENGINE_TYPE); break;