Ensure injector end angle is not greater than the maximum inj angle

This commit is contained in:
Josh Stewart 2024-01-05 14:52:35 +09:00
parent fff315aa45
commit bd25deec40
1 changed files with 1 additions and 0 deletions

View File

@ -483,6 +483,7 @@ void loop(void)
//*********************************************************************************************** //***********************************************************************************************
//BEGIN INJECTION TIMING //BEGIN INJECTION TIMING
currentStatus.injAngle = table2D_getValue(&injectorAngleTable, currentStatus.RPMdiv100); currentStatus.injAngle = table2D_getValue(&injectorAngleTable, currentStatus.RPMdiv100);
currentStatus.injAngle = max(currentStatus.injAngle, CRANK_ANGLE_MAX_INJ);
unsigned int PWdivTimerPerDegree = timeToAngleDegPerMicroSec(currentStatus.PW1); //How many crank degrees the calculated PW will take at the current speed unsigned int PWdivTimerPerDegree = timeToAngleDegPerMicroSec(currentStatus.PW1); //How many crank degrees the calculated PW will take at the current speed
injector1StartAngle = calculateInjectorStartAngle(PWdivTimerPerDegree, channel1InjDegrees, currentStatus.injAngle); injector1StartAngle = calculateInjectorStartAngle(PWdivTimerPerDegree, channel1InjDegrees, currentStatus.injAngle);