Updated for Cooling Fan controls

Updated for Cooling Fan controls
This commit is contained in:
MoysieWRX 2015-05-30 22:20:22 +03:00
parent a2137403ce
commit f40958f576
1 changed files with 12 additions and 0 deletions

View File

@ -81,6 +81,8 @@ unsigned long scheduleEnd;
byte coilHIGH = HIGH;
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;
volatile int mainLoopCount;
@ -156,6 +158,7 @@ void setup()
initialiseTimers();
initialiseDisplay();
initialiseIdle();
initialiseFan();
//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
@ -358,6 +361,15 @@ void loop()
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
//Main loop runs within this clause
if (currentStatus.hasSync && (currentStatus.RPM > 0))