From 5a06e47fd3f847227850ce00f951cc59f53f4262 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 22 Mar 2024 12:29:31 -0400 Subject: [PATCH] better names for 3/5 GM 24xs --- firmware/controllers/algo/engine_types.h | 4 ++-- .../trigger/decoders/trigger_gm.cpp | 20 +++++++++---------- .../trigger/decoders/trigger_structure.cpp | 4 ++-- .../java/com/rusefi/trigger/TriggerImage.java | 8 ++++---- unit_tests/tests/trigger/test_real_gm_24x.cpp | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/firmware/controllers/algo/engine_types.h b/firmware/controllers/algo/engine_types.h index ba43e73293..baca201e89 100644 --- a/firmware/controllers/algo/engine_types.h +++ b/firmware/controllers/algo/engine_types.h @@ -331,7 +331,7 @@ enum class trigger_type_e : uint32_t { TT_2JZ_3_34_SIMULATION_ONLY = 25, TT_ROVER_K = 26, // GM 24x with 5/10 degree gaps - TT_GM_24x = 27, + TT_GM_24x_5 = 27, TT_HONDA_CBR_600 = 28, TT_MITSU_4G9x_CAM = 29, TT_CHRYSLER_NGC_36_2_2 = 30, @@ -400,7 +400,7 @@ enum class trigger_type_e : uint32_t { TT_3_TOOTH_CRANK = 72, TT_VVT_TOYOTA_4_1 = 73, // GM 24x with 3/12 degree gaps - TT_GM_24x_2 = 74, + TT_GM_24x_3 = 74, // Renault F3R TT_60_2_2_F3R = 75, TT_MITSU_4G63_CRANK = 76, diff --git a/firmware/controllers/trigger/decoders/trigger_gm.cpp b/firmware/controllers/trigger/decoders/trigger_gm.cpp index 99b9e903bf..403ea61b9d 100644 --- a/firmware/controllers/trigger/decoders/trigger_gm.cpp +++ b/firmware/controllers/trigger/decoders/trigger_gm.cpp @@ -91,7 +91,7 @@ static int gm_tooth_pair(float startAngle, bool isShortLong, TriggerWaveform* s, } /** - * TT_GM_24x and TT_GM_24x_2 + * TT_GM_24x_5 and TT_GM_24x_3 * https://www.mediafire.com/?40mfgeoe4ctti * http://www.ls1gto.com/forums/archive/index.php/t-190549.htm * http://www.ls2.com/forums/showthread.php/834483-LS-Timing-Reluctor-Wheels-Explained @@ -102,27 +102,27 @@ static int gm_tooth_pair(float startAngle, bool isShortLong, TriggerWaveform* s, static void initGmLS24(TriggerWaveform *s, float shortToothWidth) { s->initialize(FOUR_STROKE_CRANK_SENSOR, SyncEdge::Rise); - /* + /* * Okay, here's how this magic works: * The GM 24x crank wheel has 48 edges. There is * a falling edge every 15 degrees (1/24 revolution). * After every falling edge, a rising edge occurs either * 5 or 10 (= 15 - 5) degrees later. The code 0x0A33BE * encodes the pattern of which type of gap occurs in the - * pattern. Starting from the LSB, each bit left is the + * pattern. Starting from the LSB, each bit left is the * next gap in sequence as the crank turns. A 0 indicates * long-short (late rising edge), while a 1 indicates * short-long (early rising edge). - * + * * The first few bits read are 0xE (LSB first!) = 0 - 1 - 1 - 1, so the pattern * looks like this: * ___ _ ___ ___ _ * |___| |_| |_| |___| |_ etc - * + * * | 0 | 1 | 1 | 0 | - * + * * ___ = 10 degrees, _ = 5 deg - * + * * There is a falling edge at angle=0=720, and this is position * is #1 (and #6) TDC. If there's a falling edge on the cam * sensor, it's #1 end compression stroke (fire this plug!) @@ -133,7 +133,7 @@ static void initGmLS24(TriggerWaveform *s, float shortToothWidth) { uint32_t code = 0x0A33BE; int angle = 0; - + for(int i = 0; i < 24; i++) { bool bit = code & 0x000001; @@ -143,7 +143,7 @@ static void initGmLS24(TriggerWaveform *s, float shortToothWidth) { } } -// TT_GM_24x +// TT_GM_24x_5 void initGmLS24_5deg(TriggerWaveform *s) { initGmLS24(s, 5); @@ -155,7 +155,7 @@ void initGmLS24_5deg(TriggerWaveform *s) { s->tdcPosition = 50; } -// TT_GM_24x_2 +// TT_GM_24x_3 void initGmLS24_3deg(TriggerWaveform *s) { initGmLS24(s, 3); diff --git a/firmware/controllers/trigger/decoders/trigger_structure.cpp b/firmware/controllers/trigger/decoders/trigger_structure.cpp index 527d4bcd3f..9f31955f73 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.cpp +++ b/firmware/controllers/trigger/decoders/trigger_structure.cpp @@ -744,11 +744,11 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio configureTriTach(this); break; - case trigger_type_e::TT_GM_24x: + case trigger_type_e::TT_GM_24x_5: initGmLS24_5deg(this); break; - case trigger_type_e::TT_GM_24x_2: + case trigger_type_e::TT_GM_24x_3: initGmLS24_3deg(this); break; diff --git a/java_console/trigger-ui/src/main/java/com/rusefi/trigger/TriggerImage.java b/java_console/trigger-ui/src/main/java/com/rusefi/trigger/TriggerImage.java index 887f6ffd89..1b9d187e28 100644 --- a/java_console/trigger-ui/src/main/java/com/rusefi/trigger/TriggerImage.java +++ b/java_console/trigger-ui/src/main/java/com/rusefi/trigger/TriggerImage.java @@ -58,10 +58,10 @@ public class TriggerImage { return "Honda K 1/12"; case TT_SUBARU_7_6: return "Subaru 7/6"; - case TT_GM_24x: - return "GM 24x"; - case TT_GM_24x_2: - return "GM 24x 2"; + case TT_GM_24x_3: + return "GM 24x 3"; + case TT_GM_24x_5: + return "GM 24x 5"; case TT_DODGE_NEON_1995: return "Dodge Neon 1995"; case TT_DODGE_NEON_1995_ONLY_CRANK: diff --git a/unit_tests/tests/trigger/test_real_gm_24x.cpp b/unit_tests/tests/trigger/test_real_gm_24x.cpp index 4c1aac36aa..03c06940ec 100644 --- a/unit_tests/tests/trigger/test_real_gm_24x.cpp +++ b/unit_tests/tests/trigger/test_real_gm_24x.cpp @@ -2,7 +2,7 @@ #include "logicdata_csv_reader.h" -TEST(crankingGm24x, gmRealCrankingFromFile) { +TEST(crankingGm24x_5, gmRealCrankingFromFile) { CsvReader reader(1, /* vvtCount */ 0); reader.open("tests/trigger/resources/gm_24x_cranking.csv"); @@ -10,7 +10,7 @@ TEST(crankingGm24x, gmRealCrankingFromFile) { engineConfiguration->isFasterEngineSpinUpEnabled = true; engineConfiguration->alwaysInstantRpm = true; - eth.setTriggerType(trigger_type_e::TT_GM_24x); + eth.setTriggerType(trigger_type_e::TT_GM_24x_5); int eventCount = 0; bool gotRpm = false;