Fix Miata 99-05 new ignition mode conditional (#918)

It was being applied when the trigger angle==0 regardless
of the perToothIgn ignition flag: replace || with &&.
This commit is contained in:
tx_haggis 2022-11-06 20:54:36 -06:00 committed by GitHub
parent 8e2fb0b36e
commit ad7d4f6ae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 9 deletions

View File

@ -2186,18 +2186,16 @@ void triggerPri_Miata9905(void)
//EXPERIMENTAL!
//New ignition mode is ONLY available on 9905 when the trigger angle is set to the stock value of 0.
if( (configPage2.perToothIgn == true) || (configPage4.triggerAngle == 0) )
if( (configPage2.perToothIgn == true)
&& (configPage4.triggerAngle == 0)
&& (currentStatus.advance > 0) )
{
if (currentStatus.advance > 0)
{
int16_t crankAngle = ignitionLimits( toothAngles[(toothCurrentCount-1)] );
int16_t crankAngle = ignitionLimits( toothAngles[(toothCurrentCount-1)] );
//Handle non-sequential tooth counts
if( (configPage4.sparkMode != IGN_MODE_SEQUENTIAL) && (toothCurrentCount > configPage2.nCylinders) ) { checkPerToothTiming(crankAngle, (toothCurrentCount-configPage2.nCylinders) ); }
else { checkPerToothTiming(crankAngle, toothCurrentCount); }
}
//Handle non-sequential tooth counts
if( (configPage4.sparkMode != IGN_MODE_SEQUENTIAL) && (toothCurrentCount > configPage2.nCylinders) ) { checkPerToothTiming(crankAngle, (toothCurrentCount-configPage2.nCylinders) ); }
else { checkPerToothTiming(crankAngle, toothCurrentCount); }
}
} //Has sync
toothLastMinusOneToothTime = toothLastToothTime;