Correct logic when injection angle is beyond allowable range
This commit is contained in:
parent
ffab533e7e
commit
c8b13a3804
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue