mirror of https://github.com/rusefi/speeduino.git
Updated for Cooling Fan controls
Updated for Cooling Fan controls
This commit is contained in:
parent
a2137403ce
commit
f40958f576
|
@ -81,6 +81,8 @@ unsigned long scheduleEnd;
|
||||||
|
|
||||||
byte coilHIGH = HIGH;
|
byte coilHIGH = HIGH;
|
||||||
byte coilLOW = LOW;
|
byte coilLOW = LOW;
|
||||||
|
byte FanHIGH = HIGH; // Used to invert the cooling fan output
|
||||||
|
byte FanLOW = LOW; // Used to invert the cooling fan output
|
||||||
|
|
||||||
struct statuses currentStatus;
|
struct statuses currentStatus;
|
||||||
volatile int mainLoopCount;
|
volatile int mainLoopCount;
|
||||||
|
@ -156,6 +158,7 @@ void setup()
|
||||||
initialiseTimers();
|
initialiseTimers();
|
||||||
initialiseDisplay();
|
initialiseDisplay();
|
||||||
initialiseIdle();
|
initialiseIdle();
|
||||||
|
initialiseFan();
|
||||||
|
|
||||||
//Once the configs have been loaded, a number of one time calculations can be completed
|
//Once the configs have been loaded, a number of one time calculations can be completed
|
||||||
req_fuel_uS = configPage1.reqFuel * 100; //Convert to uS and an int. This is the only variable to be used in calculations
|
req_fuel_uS = configPage1.reqFuel * 100; //Convert to uS and an int. This is the only variable to be used in calculations
|
||||||
|
@ -358,6 +361,15 @@ void loop()
|
||||||
currentStatus.O2 = o2CalibrationTable[currentStatus.O2ADC];
|
currentStatus.O2 = o2CalibrationTable[currentStatus.O2ADC];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only check the fan controls every 1000 loops to save processing power // ################
|
||||||
|
if ((mainLoopCount & 1001) == 1)
|
||||||
|
{
|
||||||
|
if (configPage4.FanEnable == 1)
|
||||||
|
{
|
||||||
|
FanControl(); // Fucntion to turn the cooling fan on/off
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Always check for sync
|
//Always check for sync
|
||||||
//Main loop runs within this clause
|
//Main loop runs within this clause
|
||||||
if (currentStatus.hasSync && (currentStatus.RPM > 0))
|
if (currentStatus.hasSync && (currentStatus.RPM > 0))
|
||||||
|
|
Loading…
Reference in New Issue