diff --git a/firmware/controllers/actuators/vvt.h b/firmware/controllers/actuators/vvt.h index a7e8875a08..a414b4e2a5 100644 --- a/firmware/controllers/actuators/vvt.h +++ b/firmware/controllers/actuators/vvt.h @@ -22,6 +22,7 @@ OutputPin* getVvtOutputPin(int index); #define BANK_BY_INDEX(index) (index / CAMS_PER_BANK) #define CAM_BY_INDEX(index) (index % CAMS_PER_BANK) +#define INDEX_BY_BANK_CAM(bank, cam) ((bank) * CAMS_PER_BANK + (cam)) class VvtController : public EngineModule, public ClosedLoopController, public vvt_s { public: diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 2d1f94200f..0d4496813a 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -256,7 +256,11 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) { // sensor noise + self-stim = loss of trigger sync return; } + handleVvtCamSignal(front, nowNt, index); +} +void handleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) { + TriggerCentral *tc = getTriggerCentral(); if (index == 0) { engine->outputChannels.vvtChannel1 = front == TriggerValue::RISE; } else if (index == 1) { diff --git a/firmware/controllers/trigger/trigger_central.h b/firmware/controllers/trigger/trigger_central.h index 90735c4da6..e792bec514 100644 --- a/firmware/controllers/trigger/trigger_central.h +++ b/firmware/controllers/trigger/trigger_central.h @@ -215,6 +215,7 @@ void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp); void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp); void hwHandleVvtCamSignal(TriggerValue front, efitick_t timestamp, int index); void hwHandleVvtCamSignal(bool isRising, efitick_t timestamp, int index); +void handleVvtCamSignal(TriggerValue front, efitick_t timestamp, int index); void validateTriggerInputs();