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 d89cd532f9
commit 492d0d2daf
2 changed files with 70 additions and 14 deletions

View File

@ -1043,7 +1043,9 @@ void triggerSetEndTeeth_BasicDistributor(void)
int tempEndAngle = (ignition1EndAngle - configPage4.triggerAngle);
tempEndAngle = ignitionLimits((tempEndAngle));
switch(configPage2.nCylinders)
{
case 4:
if( (tempEndAngle > 180) || (tempEndAngle <= 0) )
{
ignition1EndTooth = 2;
@ -1054,6 +1056,61 @@ void triggerSetEndTeeth_BasicDistributor(void)
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;
}
lastToothCalcAdvance = currentStatus.advance;

View File

@ -892,13 +892,12 @@ void initialiseAll(void)
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))