better handling of corner case

This commit is contained in:
rusefi 2019-10-10 07:07:59 -04:00
parent 821ca6156f
commit 9776d3c57d
1 changed files with 4 additions and 0 deletions

View File

@ -442,6 +442,10 @@ static int getIgnitionPinForIndex(int i DECLARE_ENGINE_PARAMETER_SUFFIX) {
return 0;
break;
case IM_WASTED_SPARK: {
if (CONFIG(specs.cylindersCount) == 1) {
// we do not want to divide by zero
return 0;
}
return i % (CONFIG(specs.cylindersCount) / 2);
}
break;