Fix decel in AE Add -mode (#971)
This commit is contained in:
parent
fec50e9db7
commit
11313ba440
|
@ -84,9 +84,9 @@ uint16_t correctionsFuel(void)
|
||||||
if (result != 100) { sumCorrections = div100(sumCorrections * result); }
|
if (result != 100) { sumCorrections = div100(sumCorrections * result); }
|
||||||
|
|
||||||
currentStatus.AEamount = correctionAccel();
|
currentStatus.AEamount = correctionAccel();
|
||||||
if (configPage2.aeApplyMode == AE_MODE_MULTIPLIER)
|
if ( (configPage2.aeApplyMode == AE_MODE_MULTIPLIER) || BIT_CHECK(currentStatus.engine, BIT_ENGINE_DCC) ) // multiply by the AE amount in case of multiplier AE mode or Decel
|
||||||
{
|
{
|
||||||
if (currentStatus.AEamount != 100) { sumCorrections = div100(sumCorrections * currentStatus.AEamount);}
|
if (currentStatus.AEamount != 100) { sumCorrections = div100(sumCorrections * currentStatus.AEamount);}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = correctionFloodClear();
|
result = correctionFloodClear();
|
||||||
|
|
|
@ -1361,11 +1361,16 @@ uint16_t PW(int REQ_FUEL, byte VE, long MAP, uint16_t corrections, int injOpen)
|
||||||
{
|
{
|
||||||
//If intermediate is not 0, we need to add the opening time (0 typically indicates that one of the full fuel cuts is active)
|
//If intermediate is not 0, we need to add the opening time (0 typically indicates that one of the full fuel cuts is active)
|
||||||
intermediate += injOpen; //Add the injector opening time
|
intermediate += injOpen; //Add the injector opening time
|
||||||
//AE Adds % of req_fuel
|
//AE calculation only when ACC is active.
|
||||||
if ( configPage2.aeApplyMode == AE_MODE_ADDER )
|
if ( BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC) )
|
||||||
{
|
{
|
||||||
intermediate += ( ((unsigned long)REQ_FUEL) * (currentStatus.AEamount - 100) ) / 100;
|
//AE Adds % of req_fuel
|
||||||
|
if ( configPage2.aeApplyMode == AE_MODE_ADDER )
|
||||||
|
{
|
||||||
|
intermediate += ( ((unsigned long)REQ_FUEL) * (currentStatus.AEamount - 100) ) / 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( intermediate > 65535)
|
if ( intermediate > 65535)
|
||||||
{
|
{
|
||||||
intermediate = 65535; //Make sure this won't overflow when we convert to uInt. This means the maximum pulsewidth possible is 65.535mS
|
intermediate = 65535; //Make sure this won't overflow when we convert to uInt. This means the maximum pulsewidth possible is 65.535mS
|
||||||
|
|
Loading…
Reference in New Issue