diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 46a6be9469..081357a15d 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -598,7 +598,10 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ #if EFI_SHAFT_POSITION_INPUT // 248 - tsOutputChannels->vvtPosition = engine->triggerCentral.getVVTPosition(0, 0); + tsOutputChannels->vvtPosition = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0); + tsOutputChannels->secondVvtPositionBank1 = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/1); + tsOutputChannels->vvtPositionBank2 = engine->triggerCentral.getVVTPosition(/*bankIndex*/1, /*camIndex*/0); + tsOutputChannels->secondVvtPositionBank2 = engine->triggerCentral.getVVTPosition(/*bankIndex*/1, /*camIndex*/1); #endif // 252 diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 30c782494e..a642e9e10e 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -79,6 +79,9 @@ int TriggerCentral::getHwEventCounter(int index) const { EXTERN_ENGINE; angle_t TriggerCentral::getVVTPosition(uint8_t bankIndex, uint8_t camIndex) { + if (bankIndex >= BANKS_COUNT || camIndex >= CAMS_PER_BANK) { + return NAN; + } return vvtPosition[bankIndex][camIndex]; }