Add a check that prevents staged injection from trying to run when there are more cylinders than injection channels

This commit is contained in:
Josh Stewart 2018-02-22 23:10:35 +11:00
parent b0df3523ed
commit 4c47ea93d3
2 changed files with 3 additions and 2 deletions

View File

@ -890,7 +890,7 @@ menuDialog = main
subMenu = afrTable1Tbl, "AFR Table", 5
subMenu = std_separator
subMenu = inj_trimad, "Sequential fuel trim", 9
subMenu = stagingTableDialog, "Staged Injection", 10
subMenu = stagingTableDialog, "Staged Injection", 10, { nCylinders <= 4 } ; Can't do staging on more than 4 cylinder engines
menu = "&Spark"
subMenu = sparkSettings, "Spark Settings"

View File

@ -1082,7 +1082,8 @@ void loop()
if( (!BIT_CHECK(currentStatus.engine, BIT_ENGINE_CRANK)) && configPage10.stagingEnabled == false) { if (currentStatus.PW1 > pwLimit) { currentStatus.PW1 = pwLimit; } }
//Calculate staging pulsewidths if used
if(configPage10.stagingEnabled == true)
//To run injection, the number of cylinder must be less than or equal to have the injector channels (ie you need at least twice as many injector channels as you have cylinders)
if( (configPage10.stagingEnabled == true) && (configPage2.nCylinders <= (INJ_CHANNELS/2)) )
{
//Scale the 'full' pulsewidth by each of the injector capacities
uint32_t tempPW1 = ((unsigned long)currentStatus.PW1 * staged_req_fuel_mult_pri) / 100;