better handling of corner case
This commit is contained in:
parent
821ca6156f
commit
9776d3c57d
|
@ -442,6 +442,10 @@ static int getIgnitionPinForIndex(int i DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case IM_WASTED_SPARK: {
|
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);
|
return i % (CONFIG(specs.cylindersCount) / 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue