diff --git a/firmware/controllers/trigger/decoders/trigger_honda.cpp b/firmware/controllers/trigger/decoders/trigger_honda.cpp index 0f2862f71d..0ba504b533 100644 --- a/firmware/controllers/trigger/decoders/trigger_honda.cpp +++ b/firmware/controllers/trigger/decoders/trigger_honda.cpp @@ -282,21 +282,21 @@ void configureHondaK_4_1(TriggerWaveform *s) { s->setTriggerSynchronizationGap3(/*gapIndex*/0, 1.11, 2.38); s->setTriggerSynchronizationGap3(/*gapIndex*/1, 0.28, 0.474); - int start = 111; - int end = 141; - s->addEventAngle(start + 180 * 0, T_PRIMARY, TV_RISE); - s->addEventAngle(end + 180 * 0, T_PRIMARY, TV_FALL); + angle_t start = 55.5; + angle_t end = 70.5; + s->addEvent360(start + 90 * 0, T_PRIMARY, TV_RISE); + s->addEvent360(end + 90 * 0, T_PRIMARY, TV_FALL); - s->addEventAngle(start + 180 * 1, T_PRIMARY, TV_RISE); - s->addEventAngle(end + 180 * 1, T_PRIMARY, TV_FALL); + s->addEvent360(start + 90 * 1, T_PRIMARY, TV_RISE); + s->addEvent360(end + 90 * 1, T_PRIMARY, TV_FALL); - s->addEventAngle(start + 180 * 2, T_PRIMARY, TV_RISE); - s->addEventAngle(end + 180 * 2, T_PRIMARY, TV_FALL); + s->addEvent360(start + 90 * 2, T_PRIMARY, TV_RISE); + s->addEvent360(end + 90 * 2, T_PRIMARY, TV_FALL); - s->addEventAngle(start + 180 * 3, T_PRIMARY, TV_RISE); - s->addEventAngle(end + 180 * 3, T_PRIMARY, TV_FALL); + s->addEvent360(start + 90 * 3, T_PRIMARY, TV_RISE); + s->addEvent360(end + 90 * 3, T_PRIMARY, TV_FALL); - s->addEventAngle(706, T_PRIMARY, TV_RISE); - s->addEventAngle(720, T_PRIMARY, TV_FALL); + s->addEvent360(353, T_PRIMARY, TV_RISE); + s->addEvent360(360, T_PRIMARY, TV_FALL); } diff --git a/firmware/controllers/trigger/decoders/trigger_structure.h b/firmware/controllers/trigger/decoders/trigger_structure.h index 335d0a8d7e..2681e3dde4 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.h +++ b/firmware/controllers/trigger/decoders/trigger_structure.h @@ -225,6 +225,9 @@ public: /** * This version of 'addEvent...' family considers the angle duration of operationMode in this trigger * For example, (0..180] for FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR + * + * TODO: one day kill all usages with FOUR_STROKE_CAM_SENSOR 720 cycle and add runtime prohibition + * TODO: for FOUR_STROKE_CAM_SENSOR addEvent360 is the way to go */ void addEventAngle(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state); diff --git a/firmware/controllers/trigger/decoders/trigger_universal.cpp b/firmware/controllers/trigger/decoders/trigger_universal.cpp index fd70f9ae22..ee4950fb73 100644 --- a/firmware/controllers/trigger/decoders/trigger_universal.cpp +++ b/firmware/controllers/trigger/decoders/trigger_universal.cpp @@ -125,19 +125,19 @@ void configureQuickStartSenderWheel(TriggerWaveform *s) { s->useRiseEdge = false; - int offset = 2 * 20; + int offset = 20; s->setTriggerSynchronizationGap3(0, 2, 3); - s->addEventAngle(offset + 2 * 0, T_PRIMARY, TV_RISE); - s->addEventAngle(offset + 2 * 70, T_PRIMARY, TV_FALL); + s->addEvent360(offset + 0, T_PRIMARY, TV_RISE); + s->addEvent360(offset + 70, T_PRIMARY, TV_FALL); - s->addEventAngle(offset + 2 * 90, T_PRIMARY, TV_RISE); - s->addEventAngle(offset + 2 * 110, T_PRIMARY, TV_FALL); + s->addEvent360(offset + 90, T_PRIMARY, TV_RISE); + s->addEvent360(offset + 110, T_PRIMARY, TV_FALL); - s->addEventAngle(offset + 2 * 180, T_PRIMARY, TV_RISE); - s->addEventAngle(offset + 2 * 200, T_PRIMARY, TV_FALL); + s->addEvent360(offset + 180, T_PRIMARY, TV_RISE); + s->addEvent360(offset + 200, T_PRIMARY, TV_FALL); - s->addEventAngle(offset + 2 * 270, T_PRIMARY, TV_RISE); - s->addEventAngle(offset + 2 * 340, T_PRIMARY, TV_FALL); + s->addEvent360(offset + 270, T_PRIMARY, TV_RISE); + s->addEvent360(offset + 340, T_PRIMARY, TV_FALL); }