mirror of https://github.com/rusefi/speeduino.git
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;
|
struct StepperIdle idleStepper;
|
||||||
bool idleOn; //Simply tracks whether idle was on last time around
|
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 iacStepTime;
|
||||||
unsigned int completedHomeSteps;
|
unsigned int completedHomeSteps;
|
||||||
|
|
||||||
|
|
4
idle.ino
4
idle.ino
|
@ -110,11 +110,13 @@ void initialiseIdle()
|
||||||
idleStepper.stepperStatus = SOFF;
|
idleStepper.stepperStatus = SOFF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
idleInitComplete = configPage4.iacAlgorithm; //Sets which idle method was initialised
|
||||||
}
|
}
|
||||||
|
|
||||||
void idleControl()
|
void idleControl()
|
||||||
{
|
{
|
||||||
|
if(idleInitComplete != configPage4.iacAlgorithm) { initialiseIdle(); }
|
||||||
|
|
||||||
switch(configPage4.iacAlgorithm)
|
switch(configPage4.iacAlgorithm)
|
||||||
{
|
{
|
||||||
case 0: //Case 0 is no idle control ('None')
|
case 0: //Case 0 is no idle control ('None')
|
||||||
|
|
|
@ -518,7 +518,6 @@ page = 9
|
||||||
requiresPowerCycle = injOpen
|
requiresPowerCycle = injOpen
|
||||||
requiresPowerCycle = IgInv
|
requiresPowerCycle = IgInv
|
||||||
requiresPowerCycle = fanInv
|
requiresPowerCycle = fanInv
|
||||||
requiresPowerCycle = iacAlgorithm
|
|
||||||
requiresPowerCycle = boostEnabled
|
requiresPowerCycle = boostEnabled
|
||||||
requiresPowerCycle = vvtEnabled
|
requiresPowerCycle = vvtEnabled
|
||||||
; requiresPowerCycle = vvtChannels
|
; requiresPowerCycle = vvtChannels
|
||||||
|
|
Loading…
Reference in New Issue