diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 9e387cdeda..b90241be5c 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -417,11 +417,15 @@ typedef enum { Force_4b_pin_input_mode = ENUM_32_BITS, } pin_input_mode_e; +#define CRANK_MODE_MULTIPLIER 2.0f + // todo: better enum name typedef enum { OM_NONE = 0, /** - * 720 degree engine cycle but trigger is defined using a 360 cycle which is when repeated + * 720 degree engine cycle but trigger is defined using a 360 cycle which is when repeated. + * For historical reasons we have a pretty weird approach where one crank trigger revolution is + * defined as if it's stretched to 720 degress. See CRANK_MODE_MULTIPLIER */ FOUR_STROKE_CRANK_SENSOR = 1, /** diff --git a/firmware/controllers/trigger/decoders/trigger_chrysler.cpp b/firmware/controllers/trigger/decoders/trigger_chrysler.cpp index 7c687c2a26..513adcde61 100644 --- a/firmware/controllers/trigger/decoders/trigger_chrysler.cpp +++ b/firmware/controllers/trigger/decoders/trigger_chrysler.cpp @@ -447,6 +447,7 @@ static void configureNeon1995TriggerShapeCommon(bool withCam, TriggerShape *s DE } void configureNeon1995TriggerShapeOnlyCrank(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { + s->initialize(FOUR_STROKE_CRANK_SENSOR, false); configureNeon1995TriggerShapeCommon(false, s PASS_ENGINE_PARAMETER_SUFFIX); } diff --git a/firmware/controllers/trigger/decoders/trigger_gm.cpp b/firmware/controllers/trigger/decoders/trigger_gm.cpp index 51418859a8..2cbde0fcfc 100644 --- a/firmware/controllers/trigger/decoders/trigger_gm.cpp +++ b/firmware/controllers/trigger/decoders/trigger_gm.cpp @@ -13,7 +13,7 @@ void configureGmTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { // all angles are x2 here - so, 5 degree width is 10 float w = 10; - float m = 2.0; + float m = CRANK_MODE_MULTIPLIER; s->addEvent2(m * 60 - w, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX); s->addEvent2(m * 60, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX); @@ -51,6 +51,7 @@ void initGmLS24(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { /** * based on http://rusefi.com/forum/viewtopic.php?f=3&t=936&start=30 logs + * todo: do we have one cycle or two cycles here? where is CRANK_MODE_MULTIPLIER? */ s->addEvent2(22.2733333333334, ch, TV_RISE PASS_ENGINE_PARAMETER_SUFFIX); s->addEvent2(27.59333333333338, ch, TV_FALL PASS_ENGINE_PARAMETER_SUFFIX);