From a21f0eb63f1e463dbca438d7b730dd56615975d8 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Wed, 19 Sep 2018 16:40:03 +1000 Subject: [PATCH] Do not attempt to perform a priming pulse or pump prime if set to 0 --- speeduino/speeduino.ino | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/speeduino/speeduino.ino b/speeduino/speeduino.ino index 80b1e34d..812d395f 100644 --- a/speeduino/speeduino.ino +++ b/speeduino/speeduino.ino @@ -833,14 +833,24 @@ void setup() } //Begin priming the fuel pump. This is turned off in the low resolution, 1s interrupt in timers.ino - FUEL_PUMP_ON(); - currentStatus.fuelPumpOn = true; + //First check that the priming time is not 0 + if(configPage2.fpPrime > 0) + { + FUEL_PUMP_ON(); + currentStatus.fuelPumpOn = true; + } + else { fpPrimed = true; } //If the user has set 0 for the pump priming, immediately mark the priming as being completed + interrupts(); //Perform the priming pulses. Set these to run at an arbitrary time in the future (100us). The prime pulse value is in ms*10, so need to multiple by 100 to get to uS - setFuelSchedule1(100, (unsigned long)(configPage2.primePulse * 100)); - setFuelSchedule2(100, (unsigned long)(configPage2.primePulse * 100)); - setFuelSchedule3(100, (unsigned long)(configPage2.primePulse * 100)); - setFuelSchedule4(100, (unsigned long)(configPage2.primePulse * 100)); + if(configPage2.primePulse > 0) + { + setFuelSchedule1(100, (unsigned long)(configPage2.primePulse * 100)); + setFuelSchedule2(100, (unsigned long)(configPage2.primePulse * 100)); + setFuelSchedule3(100, (unsigned long)(configPage2.primePulse * 100)); + setFuelSchedule4(100, (unsigned long)(configPage2.primePulse * 100)); + } + initialisationComplete = true; digitalWrite(LED_BUILTIN, HIGH);