Correct logic when injection angle is beyond allowable range

This commit is contained in:
Josh Stewart 2024-02-19 13:35:56 +11:00
parent ffab533e7e
commit c8b13a3804
1 changed files with 1 additions and 1 deletions

View File

@ -595,7 +595,7 @@ void loop()
//***********************************************************************************************
//BEGIN INJECTION TIMING
currentStatus.injAngle = table2D_getValue(&injectorAngleTable, currentStatus.RPMdiv100);
currentStatus.injAngle = max(currentStatus.injAngle, CRANK_ANGLE_MAX_INJ);
if(currentStatus.injAngle > uint16_t(CRANK_ANGLE_MAX_INJ)) { currentStatus.injAngle = uint16_t(CRANK_ANGLE_MAX_INJ); }
unsigned int PWdivTimerPerDegree = div(currentStatus.PW1, timePerDegree).quot; //How many crank degrees the calculated PW will take at the current speed
injector1StartAngle = calculateInjectorStartAngle(PWdivTimerPerDegree, channel1InjDegrees);