diff --git a/firmware/controllers/trigger/decoders/trigger_structure.cpp b/firmware/controllers/trigger/decoders/trigger_structure.cpp index cde3350098..c9157f4b7f 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.cpp +++ b/firmware/controllers/trigger/decoders/trigger_structure.cpp @@ -212,6 +212,10 @@ void TriggerWaveform::addEvent720(angle_t angle, trigger_wheel_e const channelIn addEvent(angle / 720, channelIndex, state); } +void TriggerWaveform::addEvent360(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state) { + addEvent(CRANK_MODE_MULTIPLIER * angle / 720, channelIndex, state); +} + void TriggerWaveform::addEventAngle(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state) { addEvent(angle / getCycleDuration(), channelIndex, state); } @@ -547,7 +551,7 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperat case TT_NISSAN_VQ30: case TT_NISSAN_VQ35: - initializeNissanVQcrank(this); + initializeNissanVQ35crank(this); break; case TT_KAWA_KX450F: diff --git a/firmware/controllers/trigger/decoders/trigger_structure.h b/firmware/controllers/trigger/decoders/trigger_structure.h index d93a333029..2db031b45e 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.h +++ b/firmware/controllers/trigger/decoders/trigger_structure.h @@ -223,6 +223,11 @@ public: */ void addEvent720(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state); + /** + * this method helps us use real world 350 degrees shape for FOUR_STROKE_CAM_SENSOR and FOUR_STROKE_CRANK_SENSOR + */ + void addEvent360(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state); + /** * This version of 'addEvent...' family considers the angle duration of operationMode in this trigger * For example, (0..180] for FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR