Add check to prevent potential crash when switching IAC methods (Teensy)
This commit is contained in:
parent
f53cb2e729
commit
e58ad87ed2
1
idle.h
1
idle.h
|
@ -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;
|
||||
|
||||
|
|
4
idle.ino
4
idle.ino
|
@ -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')
|
||||
|
|
|
@ -518,7 +518,6 @@ page = 9
|
|||
requiresPowerCycle = injOpen
|
||||
requiresPowerCycle = IgInv
|
||||
requiresPowerCycle = fanInv
|
||||
requiresPowerCycle = iacAlgorithm
|
||||
requiresPowerCycle = boostEnabled
|
||||
requiresPowerCycle = vvtEnabled
|
||||
; requiresPowerCycle = vvtChannels
|
||||
|
|
Loading…
Reference in New Issue