From 0863ac1a11e02b2d1c873958b9aee70d8ec19fa4 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 31 Aug 2022 19:12:45 -0700 Subject: [PATCH] rename and fix skyactiv cam mode (#4505) --- firmware/controllers/algo/engine.cpp | 4 ++-- firmware/controllers/algo/engine_types.h | 2 +- firmware/controllers/algo/rusefi_enums.h | 2 +- firmware/controllers/trigger/decoders/trigger_mazda.cpp | 5 ++--- firmware/controllers/trigger/decoders/trigger_mazda.h | 2 +- firmware/controllers/trigger/decoders/trigger_structure.cpp | 4 ++-- firmware/controllers/trigger/trigger_central.cpp | 2 +- firmware/integration/rusefi_config.txt | 4 ++-- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 9039e89896..fb813ac221 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -83,8 +83,8 @@ trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode) { return TT_FORD_ST170; case VVT_BARRA_3_PLUS_1: return TT_VVT_BARRA_3_PLUS_1; - case VVT_MAZDA_MYSTERY: - return TT_VVT_MAZDA_MYSTERY; + case VVT_MAZDA_SKYACTIV: + return TT_VVT_MAZDA_SKYACTIV; case VVT_NISSAN_VQ: return TT_VVT_NISSAN_VQ35; case VVT_TOYOTA_4_1: diff --git a/firmware/controllers/algo/engine_types.h b/firmware/controllers/algo/engine_types.h index 37f62d2cbd..0b0530cff0 100644 --- a/firmware/controllers/algo/engine_types.h +++ b/firmware/controllers/algo/engine_types.h @@ -500,7 +500,7 @@ typedef enum { TT_GM_24x_2 = 74, TT_SUBARU_EZ30 = 12, - TT_VVT_MAZDA_MYSTERY = 13, + TT_VVT_MAZDA_SKYACTIV = 13, UNUSED_21 = 21, UNUSED_34 = 34, diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 102de93c73..1f61d43d41 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -118,7 +118,7 @@ typedef enum __attribute__ ((__packed__)) { VVT_MITSUBISHI_6G75 = 14, - VVT_MAZDA_MYSTERY = 15, + VVT_MAZDA_SKYACTIV = 15, } vvt_mode_e; diff --git a/firmware/controllers/trigger/decoders/trigger_mazda.cpp b/firmware/controllers/trigger/decoders/trigger_mazda.cpp index f38146ed61..5ad1aae692 100644 --- a/firmware/controllers/trigger/decoders/trigger_mazda.cpp +++ b/firmware/controllers/trigger/decoders/trigger_mazda.cpp @@ -198,9 +198,8 @@ void initializeMazdaMiataVVtCamShape(TriggerWaveform *s) { } // https://rusefi.com/forum/viewtopic.php?f=17&t=2417 -// 2014 Mazda 2 Skyactive 1.3 -// P3-VPS Skyactiv-G -void initializeMazdaMysteryCamShape(TriggerWaveform *s) { +// Cam pattern for intake/exhaust on all Skyactiv-G (and maybe -D/-X) +void initializeMazdaSkyactivCam(TriggerWaveform *s) { s->initialize(FOUR_STROKE_CAM_SENSOR); // wide diff --git a/firmware/controllers/trigger/decoders/trigger_mazda.h b/firmware/controllers/trigger/decoders/trigger_mazda.h index ef7a6fabc3..52a9b9e0e0 100644 --- a/firmware/controllers/trigger/decoders/trigger_mazda.h +++ b/firmware/controllers/trigger/decoders/trigger_mazda.h @@ -24,4 +24,4 @@ void configureMazdaProtegeLx(TriggerWaveform *s); */ void initializeMazdaMiataVVtCamShape(TriggerWaveform *s); -void initializeMazdaMysteryCamShape(TriggerWaveform *s); +void initializeMazdaSkyactivCam(TriggerWaveform *s); diff --git a/firmware/controllers/trigger/decoders/trigger_structure.cpp b/firmware/controllers/trigger/decoders/trigger_structure.cpp index 0042af5bfc..c0caf11c78 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.cpp +++ b/firmware/controllers/trigger/decoders/trigger_structure.cpp @@ -687,8 +687,8 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio initializeSubaruEZ30(this); break; - case TT_VVT_MAZDA_MYSTERY: - initializeMazdaMysteryCamShape(this); + case TT_VVT_MAZDA_SKYACTIV: + initializeMazdaSkyactivCam(this); break; case UNUSED_21: diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index ab91b9657c..2826c9c3aa 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -177,7 +177,7 @@ static angle_t adjustCrankPhase(int camIndex) { case VVT_FORD_ST170: case VVT_BARRA_3_PLUS_1: case VVT_NISSAN_MR: - case VVT_MAZDA_MYSTERY: + case VVT_MAZDA_SKYACTIV: case VVT_MITSUBISHI_3A92: case VVT_MITSUBISHI_6G75: return syncAndReport(tc, getCrankDivider(operationMode), engineConfiguration->tempBooleanForVerySpecialCases ? 1 : 0); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 3a8f631540..f8f965c1a0 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -307,7 +307,7 @@ custom debug_mode_e 1 bits, U08, @OFFSET@, [0:5], @@debug_mode_e_enum@@ #define VM_VVT_INACTIVE 0 -#define vvt_mode_e_enum "Inactive", "Single Tooth Second Half", "2JZ", "Miata NB2", "Single Tooth First Half", "Bosch Quick Start", "4/1", "ST 170", "Ford Barra 3+1", "Nissan VQ", "Honda K 4+1", "Nissan MR18", "Mitsu 3A92", "VTwin by MAP", "Mitsu 6G75", "vvt15", "vvt16", "vvt17" +#define vvt_mode_e_enum "Inactive", "Single Tooth Second Half", "2JZ", "Miata NB2", "Single Tooth First Half", "Bosch Quick Start", "4/1", "ST 170", "Ford Barra 3+1", "Nissan VQ", "Honda K 4+1", "Nissan MR18", "Mitsu 3A92", "VTwin by MAP", "Mitsu 6G75", "Mazda Skyactiv", "vvt16", "vvt17" custom vvt_mode_e 1 bits, U08, @OFFSET@, [0:4], @@vvt_mode_e_enum@@ ! At the moment TIM1, TIM2, TIM3 and TIM9 are configured as ICU @@ -582,7 +582,7 @@ adc_channel_e fuelLevelSensor;+This is the processor pin that your fuel level se struct trigger_config_s @brief Trigger wheel(s) configuration -#define trigger_type_e_enum "custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "INVALID", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Mercedes Two Segment", "Mitsubishi 4G93", "EZ30", "MAZDA_MYSTERY", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "INVALID", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "INVALID", "Dodge Stratus", "36_2_2_2", "Nissan Primera", "dev 2JZ 3/34 simulator", "Rover K", "GM 24x 5 degree", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped", "Dodge Neon 2003 crank", "Miata NB", "INVALID", "INVALID", "Subaru 7+6", "Jeep 18-2-2-2", "12 tooth crank", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "INVALID", "Renix 44-2-2", "Renix 66-2-2-2", "Honda K 12+1", "INVALID", "36/2", "Subaru SVX", "1+16", "Subaru 7 without 6", "INVALID", "TriTach", "GM 60/2/2/2", "Skoda Favorit", "Barra 3+1 Cam", "Kawa KX450F", "Nissan VQ35", "INVALID", "Nissan VQ30", "Nissan QR25", "Mitsubishi 3A92", "Subaru SVX Crank 1", "Subaru SVX Cam VVT", "Ford PIP", "Suzuki G13B", "Honda K 4+1", "Nissan MR18 Crank", "32/2", "36-2-1", "36-2-1-1", "INVALID", "INVALID", "GM 24x 3 degree", "trg75" +#define trigger_type_e_enum "custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "INVALID", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Mercedes Two Segment", "Mitsubishi 4G93", "EZ30", "INVALID", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "INVALID", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "INVALID", "Dodge Stratus", "36_2_2_2", "Nissan Primera", "dev 2JZ 3/34 simulator", "Rover K", "GM 24x 5 degree", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped", "Dodge Neon 2003 crank", "Miata NB", "INVALID", "INVALID", "Subaru 7+6", "Jeep 18-2-2-2", "12 tooth crank", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "INVALID", "Renix 44-2-2", "Renix 66-2-2-2", "Honda K 12+1", "INVALID", "36/2", "Subaru SVX", "1+16", "Subaru 7 without 6", "INVALID", "TriTach", "GM 60/2/2/2", "Skoda Favorit", "Barra 3+1 Cam", "Kawa KX450F", "Nissan VQ35", "INVALID", "Nissan VQ30", "Nissan QR25", "Mitsubishi 3A92", "Subaru SVX Crank 1", "Subaru SVX Cam VVT", "Ford PIP", "Suzuki G13B", "Honda K 4+1", "Nissan MR18 Crank", "32/2", "36-2-1", "36-2-1-1", "INVALID", "INVALID", "GM 24x 3 degree", "trg75" custom trigger_type_e 4 bits, U32, @OFFSET@, [0:6], @@trigger_type_e_enum@@ trigger_type_e type;+https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers\nset trigger_type X