From 7361b46160f80a7f8d8ec58a3d4eb6f9c9f63274 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Tue, 20 Feb 2024 15:55:40 +1100 Subject: [PATCH] Only calculate corrections values on the secondary spark looked if either of the table switching modes are used (Not Multiple or Add) Fixes #1154 --- speeduino/secondaryTables.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/speeduino/secondaryTables.cpp b/speeduino/secondaryTables.cpp index ba4e4ed5..eecf4726 100644 --- a/speeduino/secondaryTables.cpp +++ b/speeduino/secondaryTables.cpp @@ -215,7 +215,9 @@ byte getAdvance2(void) } else { currentStatus.ignLoad2 = currentStatus.MAP; } tempAdvance = get3DTableValue(&ignitionTable2, currentStatus.ignLoad2, currentStatus.RPM) - OFFSET_IGNITION; //As above, but for ignition advance - tempAdvance = correctionsIgn(tempAdvance); + + //Perform the corrections calculation on the secondary advance value, only if it uses a switched mode + if( (configPage10.spark2SwitchVariable == SPARK2_MODE_CONDITIONAL_SWITCH) || (configPage10.spark2SwitchVariable == SPARK2_MODE_INPUT_SWITCH) ) { tempAdvance = correctionsIgn(tempAdvance); } return tempAdvance; }