From dd9e431782a1177e73ef9fcf82364975d578c86b Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 3 Dec 2020 01:36:43 -0500 Subject: [PATCH] dead code matches Mazda SOHC --- .../controllers/algo/auto_generated_enums.cpp | 4 +-- .../controllers/algo/auto_generated_enums.cpp | 4 +-- .../controllers/algo/auto_generated_enums.cpp | 4 +-- firmware/controllers/algo/rusefi_enums.h | 17 +++++----- .../trigger/decoders/trigger_mazda.cpp | 34 ------------------- .../trigger/decoders/trigger_mazda.h | 1 - .../trigger/decoders/trigger_structure.cpp | 5 +-- 7 files changed, 16 insertions(+), 53 deletions(-) diff --git a/firmware/config/boards/hellen/cypress/config/controllers/algo/auto_generated_enums.cpp b/firmware/config/boards/hellen/cypress/config/controllers/algo/auto_generated_enums.cpp index 0a8503f57c..6f14c9032e 100644 --- a/firmware/config/boards/hellen/cypress/config/controllers/algo/auto_generated_enums.cpp +++ b/firmware/config/boards/hellen/cypress/config/controllers/algo/auto_generated_enums.cpp @@ -1387,8 +1387,8 @@ case TT_MAZDA_MIATA_VVT_TEST: return "TT_MAZDA_MIATA_VVT_TEST"; case TT_MAZDA_SOHC_4: return "TT_MAZDA_SOHC_4"; -case TT_MAZDA_Z5: - return "TT_MAZDA_Z5"; +case TT_UNUSED_42: + return "TT_UNUSED_42"; case TT_MIATA_VVT: return "TT_MIATA_VVT"; case TT_MITSUBISHI: diff --git a/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp b/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp index f6d9039708..243da13de7 100644 --- a/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp +++ b/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp @@ -1183,8 +1183,8 @@ case TT_MAZDA_MIATA_VVT_TEST: return "TT_MAZDA_MIATA_VVT_TEST"; case TT_MAZDA_SOHC_4: return "TT_MAZDA_SOHC_4"; -case TT_MAZDA_Z5: - return "TT_MAZDA_Z5"; +case TT_UNUSED_42: + return "TT_UNUSED_42"; case TT_MIATA_VVT: return "TT_MIATA_VVT"; case TT_MITSUBISHI: diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index df5bf44948..8c29fc828c 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -1329,8 +1329,8 @@ case TT_MAZDA_MIATA_VVT_TEST: return "TT_MAZDA_MIATA_VVT_TEST"; case TT_MAZDA_SOHC_4: return "TT_MAZDA_SOHC_4"; -case TT_MAZDA_Z5: - return "TT_MAZDA_Z5"; +case TT_UNUSED_42: + return "TT_UNUSED_42"; case TT_MIATA_VVT: return "TT_MIATA_VVT"; case TT_MITSUBISHI: diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index fccf8621e7..8d7a11fd61 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -214,6 +214,9 @@ typedef enum { * @see http://rusefi.com/wiki/index.php?title=Manual:Software:Trigger */ typedef enum { + TT_UNUSED_6 = 6, + TT_UNUSED_42 = 42, + TT_TOOTHED_WHEEL = TT_TT_TOOTHED_WHEEL, TT_FORD_ASPIRE = 1, TT_DODGE_NEON_1995 = 2, @@ -225,9 +228,8 @@ typedef enum { * NB1 means non-VVT NB, 99 and 00 1.8 engine */ TT_MAZDA_MIATA_NB1 = TT_TT_MAZDA_MIATA_NB1, - TT_GM_7X = 5, - TT_UNUSED_6 = 6, - TT_MAZDA_SOHC_4 = TT_TT_GM_7X, + TT_GM_7X = TT_TT_GM_7X, + TT_MAZDA_SOHC_4 = TT_TT_MAZDA_SOHC_4, /** * "60/2" * See also TT_ONE_PLUS_TOOTHED_WHEEL_60_2 @@ -248,7 +250,7 @@ typedef enum { // cam-based TT_DODGE_NEON_2003_CAM = 14, - TT_MAZDA_DOHC_1_4 = 15, + TT_MAZDA_DOHC_1_4 = TT_TT_MAZDA_DOHC_1_4, /** * "1+1" - one tooth on primary channel, one tooth on secondary channel @@ -257,7 +259,7 @@ typedef enum { */ TT_ONE_PLUS_ONE = 16, // "1+60/2" - TT_VVT_JZ = 17, + TT_VVT_JZ = TT_TT_VVT_JZ, // just one channel with just one tooth TT_ONE = TT_TT_ONE, @@ -280,7 +282,7 @@ typedef enum { */ TT_NISSAN_SR20VE = 24, - TT_2JZ_3_34 = 25, + TT_2JZ_3_34 = TT_TT_2JZ_3_34, TT_ROVER_K = 26, @@ -329,13 +331,12 @@ typedef enum { TT_DODGE_NEON_1995_ONLY_CRANK = 39, // Jeep XJ 2500cc 4 cylinder. See also TT_JEEP_18_2_2_2 for 6 cylinders - TT_JEEP_4_CYL = 40, + TT_JEEP_4_CYL = TT_TT_JEEP_4_CYL, // magneti marelli Fiat/Lancia IAW P8 from the 90', 2.0 16 v turbo engine - Lancia Coupe // https://rusefi.com/forum/viewtopic.php?f=5&t=1440 TT_FIAT_IAW_P8 = 41, - TT_MAZDA_Z5 = 42, /** * cam sensor of Mazda Miata NB2 - the VVT signal shape diff --git a/firmware/controllers/trigger/decoders/trigger_mazda.cpp b/firmware/controllers/trigger/decoders/trigger_mazda.cpp index f3902acc0d..175aa07cda 100644 --- a/firmware/controllers/trigger/decoders/trigger_mazda.cpp +++ b/firmware/controllers/trigger/decoders/trigger_mazda.cpp @@ -52,40 +52,6 @@ void initializeMazdaMiataNaShape(TriggerWaveform *s) { s->useOnlyPrimaryForSync = true; } -/** - * by alexander-n8hgeg5e - * See https://rusefi.com/forum/viewtopic.php?f=5&t=1447 - */ -void initialize_Mazda_Engine_z5_Shape(TriggerWaveform *s) { - s->initialize(FOUR_STROKE_CAM_SENSOR); - /** - * My Signal is: 60, 60, 102, 60 - * 120, 120, 120, 78, - * ^ - * | - * sync point = 0 degree from now on - * All rising edges are 60 befor some OT. - * If the edge goes high, it should look at the last past 2 events. (high-low-now) - * time1/time2 == 78/102 = 13/17 then triggerevent '0' would be nice. - * - */ - s->useRiseEdge = false; - s->tdcPosition = 0; // 1 and 3 are at top , so 0 or 360 - s->setTriggerSynchronizationGap(0.7); - - s->addEvent720(60.0f, T_PRIMARY, TV_FALL); - s->addEvent720(180.0f, T_PRIMARY, TV_RISE); - - s->addEvent720(240.0f, T_PRIMARY, TV_FALL); - s->addEvent720(360.0f, T_PRIMARY, TV_RISE); - - s->addEvent720(420.0f, T_PRIMARY, TV_FALL); - s->addEvent720(540.0f, T_PRIMARY, TV_RISE); - - s->addEvent720(618.0f, T_PRIMARY, TV_FALL); - s->addEvent720(720.0f, T_PRIMARY, TV_RISE); -} - // TT_MIATA_VVT void initializeMazdaMiataNb2Crank(TriggerWaveform *s) { s->initialize(FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR); diff --git a/firmware/controllers/trigger/decoders/trigger_mazda.h b/firmware/controllers/trigger/decoders/trigger_mazda.h index ab79ae4166..17746e43c5 100644 --- a/firmware/controllers/trigger/decoders/trigger_mazda.h +++ b/firmware/controllers/trigger/decoders/trigger_mazda.h @@ -17,7 +17,6 @@ void initializeMazdaMiataNb2Crank(TriggerWaveform *s); void initializeMazdaMiataVVtTestShape(TriggerWaveform *s); void configureMazdaProtegeSOHC(TriggerWaveform *s); void configureMazdaProtegeLx(TriggerWaveform *s); -void initialize_Mazda_Engine_z5_Shape(TriggerWaveform *s); /** * TT_VVT_MIATA_NB2 diff --git a/firmware/controllers/trigger/decoders/trigger_structure.cpp b/firmware/controllers/trigger/decoders/trigger_structure.cpp index b7f168dfa1..f5d2f50fe5 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.cpp +++ b/firmware/controllers/trigger/decoders/trigger_structure.cpp @@ -476,10 +476,7 @@ void TriggerWaveform::initializeTriggerWaveform(Logging *logger, operation_mode_ initializeMazdaMiataVVtTestShape(this); break; - case TT_MAZDA_Z5: - initialize_Mazda_Engine_z5_Shape(this); - break; - + case TT_UNUSED_42: case TT_VVT_MIATA_NB2: initializeMazdaMiataVVtCamShape(this); break;