Fix for new ign mode on 8 cylinder, single channel output

This commit is contained in:
Josh Stewart 2023-05-15 13:16:40 +10:00
parent d53b94c4ef
commit b8df0a0890
2 changed files with 70 additions and 14 deletions

View File

@ -1038,17 +1038,74 @@ void triggerSetEndTeeth_BasicDistributor()
int tempEndAngle = (ignition1EndAngle - configPage4.triggerAngle);
tempEndAngle = ignitionLimits((tempEndAngle));
switch(configPage2.nCylinders)
{
case 4:
if( (tempEndAngle > 180) || (tempEndAngle <= 0) )
{
ignition1EndTooth = 2;
ignition2EndTooth = 1;
}
else
{
ignition1EndTooth = 1;
ignition2EndTooth = 2;
}
break;
case 3: //Shared with 6 cylinder
case 6:
if( (tempEndAngle > 120) && (tempEndAngle <= 240) )
{
ignition1EndTooth = 2;
ignition2EndTooth = 3;
ignition3EndTooth = 1;
}
else if( (tempEndAngle > 240) || (tempEndAngle <= 0) )
{
ignition1EndTooth = 3;
ignition2EndTooth = 1;
ignition3EndTooth = 2;
}
else
{
ignition1EndTooth = 1;
ignition2EndTooth = 2;
ignition3EndTooth = 3;
}
break;
case 8:
if( (tempEndAngle > 90) && (tempEndAngle <= 180) )
{
ignition1EndTooth = 2;
ignition2EndTooth = 3;
ignition3EndTooth = 4;
ignition4EndTooth = 1;
}
else if( (tempEndAngle > 180) && (tempEndAngle <= 270) )
{
ignition1EndTooth = 3;
ignition2EndTooth = 4;
ignition3EndTooth = 1;
ignition4EndTooth = 2;
}
else if( (tempEndAngle > 270) || (tempEndAngle <= 0) )
{
ignition1EndTooth = 4;
ignition2EndTooth = 1;
ignition3EndTooth = 2;
ignition4EndTooth = 3;
}
else
{
ignition1EndTooth = 1;
ignition2EndTooth = 2;
ignition3EndTooth = 3;
ignition4EndTooth = 4;
}
break;
}
if( (tempEndAngle > 180) || (tempEndAngle <= 0) )
{
ignition1EndTooth = 2;
ignition2EndTooth = 1;
}
else
{
ignition1EndTooth = 1;
ignition2EndTooth = 2;
}
lastToothCalcAdvance = currentStatus.advance;

View File

@ -799,13 +799,12 @@ void initialiseAll()
channel4IgnDegrees = 270;
maxIgnOutputs = 4;
#if IGN_CHANNELS >= 1
if( (configPage4.sparkMode == IGN_MODE_SINGLE))
{
maxIgnOutputs = 1;
CRANK_ANGLE_MAX_IGN = 90;
maxIgnOutputs = 4;
CRANK_ANGLE_MAX_IGN = 360;
}
#endif
#if IGN_CHANNELS >= 8
if( (configPage4.sparkMode == IGN_MODE_SEQUENTIAL))