From 0ec8b8d46cb01c47ac4340d37a00c61cd3d8c278 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 25 Nov 2021 20:45:58 -0500 Subject: [PATCH] reliable 32/2 trigger shape --- firmware/controllers/algo/engine_types.h | 6 ++++-- .../controllers/trigger/decoders/trigger_structure.cpp | 7 +++++++ firmware/integration/rusefi_config.txt | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/firmware/controllers/algo/engine_types.h b/firmware/controllers/algo/engine_types.h index 4ce4ce7679..5b3ad9295d 100644 --- a/firmware/controllers/algo/engine_types.h +++ b/firmware/controllers/algo/engine_types.h @@ -522,14 +522,16 @@ typedef enum { TT_NISSAN_MR18_CRANK = 68, + TT_TOOTHED_WHEEL_32_2 = 69, + + // do not forget to edit "#define trigger_type_e_enum" line in integration/rusefi_config.txt file to propogate new value to rusefi.ini TS project // do not forget to invoke "gen_config.bat" once you make changes to integration/rusefi_config.txt // todo: one day a hero would integrate some of these things into Makefile in order to reduce manual magic // // Another point: once you add a new trigger, run get_trigger_images.bat which would run rusefi_test.exe from unit_tests // - // todo: before increasing from 69 to 70 we shall use the half dozen of unused IDs - TT_UNUSED = 69, // this is used if we want to iterate over all trigger types + TT_UNUSED = 70, // this is used if we want to iterate over all trigger types // todo: convert to ENUM_16_BITS? I can see 257 triggers but not 65K triggers Force_4_bytes_size_trigger_type = ENUM_32_BITS, diff --git a/firmware/controllers/trigger/decoders/trigger_structure.cpp b/firmware/controllers/trigger/decoders/trigger_structure.cpp index e44b94d108..0e715a6100 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.cpp +++ b/firmware/controllers/trigger/decoders/trigger_structure.cpp @@ -598,6 +598,13 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperat setToothedWheelConfiguration(this, 3, 0, ambiguousOperationMode); break; + case TT_TOOTHED_WHEEL_32_2: + setToothedWheelConfiguration(this, 32, 2, ambiguousOperationMode); + // todo: add this second/third into 'setToothedWheelConfiguration' as long as we have enough tooth? + setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise + setThirdTriggerSynchronizationGap(1); + break; + case TT_TOOTHED_WHEEL_60_2: setToothedWheelConfiguration(this, 60, 2, ambiguousOperationMode); setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 966f1f3fba..0ba63d9567 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -566,7 +566,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", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Mercedes Two Segment", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "INVALID", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Honda 1+24", "Dodge Stratus", "36_2_2_2", "Nissan Primera", "dev 2JZ 3/34 simulator", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped", "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "WIP", "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", "INVALID", "Subaru SVX Crank 1", "Subaru SVX Cam VVT", "Ford PIP", "Suzuki G13B", "Honda K 4+1", "Nissan MR18 Crank", "INVALID" +#define trigger_type_e_enum "custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Mercedes Two Segment", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "INVALID", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Honda 1+24", "Dodge Stratus", "36_2_2_2", "Nissan Primera", "dev 2JZ 3/34 simulator", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped", "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "WIP", "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", "INVALID", "Subaru SVX Crank 1", "Subaru SVX Cam VVT", "Ford PIP", "Suzuki G13B", "Honda K 4+1", "Nissan MR18 Crank", "32/2", "trg70", "trg71" 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