diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index c30576fcd4..f8a0dd5d9a 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -18,9 +18,18 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->hasMapSensor = true; - engineConfiguration->trigger.type = TT_MIATA_VVT; + engineConfiguration->trigger.type = TT_ONE; engineConfiguration->specs.displacement = 1.8; + boardConfiguration->triggerInputPins[0] = GPIOA_5; + boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED; + engineConfiguration->camInput = GPIOC_6; + + boardConfiguration->miataNb2 = true; + boardConfiguration->vvtCamSensorUseRise = true; + + + engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 49a6ec170f..3c77604d3e 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -85,7 +85,7 @@ void hwHandleVvtCamSignal(trigger_value_e front) { addEngineSniffferEvent(VVT_NAME, front == TV_RISE ? WC_UP : WC_DOWN); } - if (boardConfiguration->vvtCamSensorUseRise && front == TV_FALL) { + if (boardConfiguration->vvtCamSensorUseRise ^ (front != TV_FALL)) { return; }