Add check to prevent potential crash when switching IAC methods (Teensy)

This commit is contained in:
Josh Stewart 2017-01-12 22:33:26 +11:00
parent f53cb2e729
commit e58ad87ed2
3 changed files with 4 additions and 2 deletions

1
idle.h
View File

@ -23,6 +23,7 @@ struct table2D iacCrankDutyTable;
struct StepperIdle idleStepper;
bool idleOn; //Simply tracks whether idle was on last time around
byte idleInitComplete = 99; //TRacks which idle method was initialised. 99 is a method that will never exist
unsigned int iacStepTime;
unsigned int completedHomeSteps;

View File

@ -110,11 +110,13 @@ void initialiseIdle()
idleStepper.stepperStatus = SOFF;
break;
}
idleInitComplete = configPage4.iacAlgorithm; //Sets which idle method was initialised
}
void idleControl()
{
if(idleInitComplete != configPage4.iacAlgorithm) { initialiseIdle(); }
switch(configPage4.iacAlgorithm)
{
case 0: //Case 0 is no idle control ('None')

View File

@ -518,7 +518,6 @@ page = 9
requiresPowerCycle = injOpen
requiresPowerCycle = IgInv
requiresPowerCycle = fanInv
requiresPowerCycle = iacAlgorithm
requiresPowerCycle = boostEnabled
requiresPowerCycle = vvtEnabled
; requiresPowerCycle = vvtChannels