From 09d020b9529399fbadca4a3a4ec6a32a0f31894c Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 9 Sep 2021 14:11:48 -0400 Subject: [PATCH] https://rusefi.com/forum/viewtopic.php?p=42108#p42108 VVT table validation only if camInput defined --- firmware/controllers/engine_controller.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 9e3e07a4fb..598f73d42d 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -688,10 +688,17 @@ bool validateConfig(DECLARE_CONFIG_PARAMETER_SIGNATURE) { ensureArrayIsAscending("Pedal map RPM", config->pedalToTpsRpmBins); // VVT - ensureArrayIsAscending("VVT intake load", config->vvtTable1LoadBins); - ensureArrayIsAscending("VVT intake RPM", config->vvtTable1RpmBins); - ensureArrayIsAscending("VVT exhaust load", config->vvtTable2LoadBins); - ensureArrayIsAscending("VVT exhaust RPM", config->vvtTable2RpmBins); + if (CONFIG(camInputs[0]) != GPIO_UNASSIGNED) { + ensureArrayIsAscending("VVT intake load", config->vvtTable1LoadBins); + ensureArrayIsAscending("VVT intake RPM", config->vvtTable1RpmBins); + } + +#if CAM_INPUTS_COUNT != 1 + if (CONFIG(camInputs[1]) != GPIO_UNASSIGNED) { + ensureArrayIsAscending("VVT exhaust load", config->vvtTable2LoadBins); + ensureArrayIsAscending("VVT exhaust RPM", config->vvtTable2RpmBins); + } +#endif return true; }